ELP: two-layer activation pipeline (activate → suppress → reason → generate)

elp-input.el: replace broken engram_search_json with engram_activate_json
as Layer 1. Layer 2 suppress/filter keeps nodes with non-zero salience/
importance. Reason step extracts patient from top activated node content.
ELP grammar realizes the response via generate().

routes.el: add 'elp' event_type to handle_dharma_recv so the studio can
route ELP requests through dharma.
This commit is contained in:
Will Anderson
2026-05-03 11:31:04 -05:00
parent e299c92662
commit 2622bb04bd
94 changed files with 52848 additions and 0 deletions
+723
View File
@@ -0,0 +1,723 @@
#include <stdint.h>
#include <stdlib.h>
#include "el_runtime.h"
el_val_t str_drop_last(el_val_t s, el_val_t n);
el_val_t hi_str_ends(el_val_t s, el_val_t suf);
el_val_t hi_str_drop_last(el_val_t s, el_val_t n);
el_val_t hi_str_last_char(el_val_t s);
el_val_t hi_gender(el_val_t noun);
el_val_t hi_masc_aa_stem(el_val_t noun);
el_val_t hi_noun_direct_m(el_val_t noun, el_val_t number);
el_val_t hi_noun_oblique_m(el_val_t noun, el_val_t number);
el_val_t hi_noun_direct_f(el_val_t noun, el_val_t number);
el_val_t hi_noun_oblique_f(el_val_t noun, el_val_t number);
el_val_t hi_noun_direct(el_val_t noun, el_val_t gender, el_val_t number);
el_val_t hi_noun_oblique(el_val_t noun, el_val_t gender, el_val_t number);
el_val_t hi_postposition(el_val_t gram_case);
el_val_t hi_agree_genitive(el_val_t possessed_gender, el_val_t possessed_number);
el_val_t hi_verb_stem(el_val_t infinitive);
el_val_t hi_verb_stem_clean(el_val_t infinitive);
el_val_t hi_present_aspect(el_val_t gender, el_val_t number);
el_val_t hi_aux_present(el_val_t person, el_val_t number);
el_val_t hi_past_suffix(el_val_t gender, el_val_t number);
el_val_t hi_past_irregular(el_val_t stem, el_val_t gender, el_val_t number);
el_val_t hi_future_suffix(el_val_t person, el_val_t number, el_val_t gender);
el_val_t hi_tense_suffix(el_val_t tense, el_val_t gender, el_val_t number);
el_val_t hi_hona_present(el_val_t person, el_val_t number);
el_val_t hi_hona_past(el_val_t gender, el_val_t number);
el_val_t hi_conjugate(el_val_t verb, el_val_t tense, el_val_t person, el_val_t gender, el_val_t number);
el_val_t hi_noun_with_post(el_val_t noun, el_val_t gender, el_val_t number, el_val_t gram_case);
el_val_t hi_genitive_phrase(el_val_t possessor, el_val_t possessor_gender, el_val_t possessor_number, el_val_t possessed, el_val_t possessed_gender, el_val_t possessed_number);
el_val_t hi_str_ends(el_val_t s, el_val_t suf) {
return str_ends_with(s, suf);
return 0;
}
el_val_t hi_str_drop_last(el_val_t s, el_val_t n) {
el_val_t len = str_len(s);
if (n >= len) {
return EL_STR("");
}
return str_slice(s, 0, (len - n));
return 0;
}
el_val_t hi_str_last_char(el_val_t s) {
el_val_t n = str_len(s);
if (n == 0) {
return EL_STR("");
}
return str_slice(s, (n - 1), n);
return 0;
}
el_val_t hi_gender(el_val_t noun) {
if (hi_str_ends(noun, EL_STR("\xe0\xa5\x80"))) {
return EL_STR("f");
}
if (hi_str_ends(noun, EL_STR("\xe0\xa4\xbe"))) {
return EL_STR("m");
}
if (hi_str_ends(noun, EL_STR("\xe0\xa4\xa8"))) {
return EL_STR("f");
}
if (hi_str_ends(noun, EL_STR("\xe0\xa4\xa4"))) {
return EL_STR("f");
}
if (hi_str_ends(noun, EL_STR("\xe0\xa4\x9f"))) {
return EL_STR("f");
}
if (hi_str_ends(noun, EL_STR("\xe0\xa4\xb6"))) {
return EL_STR("m");
}
if (str_eq(noun, EL_STR("\xe0\xa4\xb2\xe0\xa4\xa1\xe0\xa4\xbc\xe0\xa4\x95\xe0\xa4\xbe"))) {
return EL_STR("m");
}
if (str_eq(noun, EL_STR("\xe0\xa4\xb2\xe0\xa4\xa1\xe0\xa4\xbc\xe0\xa4\x95\xe0\xa5\x80"))) {
return EL_STR("f");
}
if (str_eq(noun, EL_STR("\xe0\xa4\x86\xe0\xa4\xa6\xe0\xa4\xae\xe0\xa5\x80"))) {
return EL_STR("m");
}
if (str_eq(noun, EL_STR("\xe0\xa4\x94\xe0\xa4\xb0\xe0\xa4\xa4"))) {
return EL_STR("f");
}
if (str_eq(noun, EL_STR("\xe0\xa4\x98\xe0\xa4\xb0"))) {
return EL_STR("m");
}
if (str_eq(noun, EL_STR("\xe0\xa4\xae\xe0\xa5\x87\xe0\xa4\x9c\xe0\xa4\xbc"))) {
return EL_STR("f");
}
if (str_eq(noun, EL_STR("\xe0\xa4\x95\xe0\xa4\xbf\xe0\xa4\xa4\xe0\xa4\xbe\xe0\xa4\xac"))) {
return EL_STR("f");
}
if (str_eq(noun, EL_STR("\xe0\xa4\xaa\xe0\xa4\xbe\xe0\xa4\xa8\xe0\xa5\x80"))) {
return EL_STR("m");
}
if (str_eq(noun, EL_STR("\xe0\xa4\xa6\xe0\xa5\x82\xe0\xa4\xa7"))) {
return EL_STR("m");
}
if (str_eq(noun, EL_STR("\xe0\xa4\xb9\xe0\xa4\xbe\xe0\xa4\xa5"))) {
return EL_STR("m");
}
if (str_eq(noun, EL_STR("\xe0\xa4\x86\xe0\xa4\x81\xe0\xa4\x96"))) {
return EL_STR("f");
}
if (str_eq(noun, EL_STR("\xe0\xa4\xac\xe0\xa4\x9a\xe0\xa5\x8d\xe0\xa4\x9a\xe0\xa4\xbe"))) {
return EL_STR("m");
}
if (str_eq(noun, EL_STR("\xe0\xa4\xac\xe0\xa4\x9a\xe0\xa5\x8d\xe0\xa4\x9a\xe0\xa5\x80"))) {
return EL_STR("f");
}
if (str_eq(noun, EL_STR("\xe0\xa4\x95\xe0\xa4\xbe\xe0\xa4\xae"))) {
return EL_STR("m");
}
if (str_eq(noun, EL_STR("\xe0\xa4\xac\xe0\xa4\xbe\xe0\xa4\xa4"))) {
return EL_STR("f");
}
if (str_eq(noun, EL_STR("\xe0\xa4\xa6\xe0\xa4\xbf\xe0\xa4\xa8"))) {
return EL_STR("m");
}
if (str_eq(noun, EL_STR("\xe0\xa4\xb0\xe0\xa4\xbe\xe0\xa4\xa4"))) {
return EL_STR("f");
}
if (str_eq(noun, EL_STR("\xe0\xa4\xa6\xe0\xa5\x87\xe0\xa4\xb6"))) {
return EL_STR("m");
}
if (str_eq(noun, EL_STR("\xe0\xa4\xad\xe0\xa4\xbe\xe0\xa4\xb7\xe0\xa4\xbe"))) {
return EL_STR("f");
}
if (str_eq(noun, EL_STR("\xe0\xa4\x9c\xe0\xa4\x97\xe0\xa4\xb9"))) {
return EL_STR("f");
}
if (str_eq(noun, EL_STR("\xe0\xa4\xb8\xe0\xa4\xae\xe0\xa4\xaf"))) {
return EL_STR("m");
}
if (str_eq(noun, EL_STR("\xe0\xa4\xb8\xe0\xa4\xbe\xe0\xa4\xb2"))) {
return EL_STR("m");
}
return EL_STR("m");
return 0;
}
el_val_t hi_masc_aa_stem(el_val_t noun) {
return hi_str_drop_last(noun, 1);
return 0;
}
el_val_t hi_noun_direct_m(el_val_t noun, el_val_t number) {
if (hi_str_ends(noun, EL_STR("\xe0\xa4\xbe"))) {
if (str_eq(number, EL_STR("sg"))) {
return noun;
}
return el_str_concat(hi_masc_aa_stem(noun), EL_STR("\xe0\xa5\x87"));
}
return noun;
return 0;
}
el_val_t hi_noun_oblique_m(el_val_t noun, el_val_t number) {
if (hi_str_ends(noun, EL_STR("\xe0\xa4\xbe"))) {
el_val_t stem = hi_masc_aa_stem(noun);
if (str_eq(number, EL_STR("sg"))) {
return el_str_concat(stem, EL_STR("\xe0\xa5\x87"));
}
return el_str_concat(stem, EL_STR("\xe0\xa5\x8b\xe0\xa4\x82"));
}
if (hi_str_ends(noun, EL_STR("\xe0\xa5\x80"))) {
if (str_eq(number, EL_STR("sg"))) {
return noun;
}
el_val_t stem = hi_str_drop_last(noun, 1);
return el_str_concat(stem, EL_STR("\xe0\xa4\xbf\xe0\xa4\xaf\xe0\xa5\x8b\xe0\xa4\x82"));
}
if (str_eq(number, EL_STR("sg"))) {
return noun;
}
return el_str_concat(noun, EL_STR("\xe0\xa5\x8b\xe0\xa4\x82"));
return 0;
}
el_val_t hi_noun_direct_f(el_val_t noun, el_val_t number) {
if (hi_str_ends(noun, EL_STR("\xe0\xa5\x80"))) {
if (str_eq(number, EL_STR("sg"))) {
return noun;
}
el_val_t stem = hi_str_drop_last(noun, 1);
return el_str_concat(stem, EL_STR("\xe0\xa4\xbf\xe0\xa4\xaf\xe0\xa4\xbe\xe0\xa4\x81"));
}
if (str_eq(number, EL_STR("sg"))) {
return noun;
}
return el_str_concat(noun, EL_STR("\xe0\xa5\x87\xe0\xa4\x82"));
return 0;
}
el_val_t hi_noun_oblique_f(el_val_t noun, el_val_t number) {
if (hi_str_ends(noun, EL_STR("\xe0\xa5\x80"))) {
if (str_eq(number, EL_STR("sg"))) {
return noun;
}
el_val_t stem = hi_str_drop_last(noun, 1);
return el_str_concat(stem, EL_STR("\xe0\xa4\xbf\xe0\xa4\xaf\xe0\xa5\x8b\xe0\xa4\x82"));
}
if (str_eq(number, EL_STR("sg"))) {
return noun;
}
return el_str_concat(noun, EL_STR("\xe0\xa5\x8b\xe0\xa4\x82"));
return 0;
}
el_val_t hi_noun_direct(el_val_t noun, el_val_t gender, el_val_t number) {
if (str_eq(gender, EL_STR("m"))) {
return hi_noun_direct_m(noun, number);
}
if (str_eq(gender, EL_STR("f"))) {
return hi_noun_direct_f(noun, number);
}
return noun;
return 0;
}
el_val_t hi_noun_oblique(el_val_t noun, el_val_t gender, el_val_t number) {
if (str_eq(gender, EL_STR("m"))) {
return hi_noun_oblique_m(noun, number);
}
if (str_eq(gender, EL_STR("f"))) {
return hi_noun_oblique_f(noun, number);
}
return noun;
return 0;
}
el_val_t hi_postposition(el_val_t gram_case) {
if (str_eq(gram_case, EL_STR("nominative"))) {
return EL_STR("");
}
if (str_eq(gram_case, EL_STR("accusative_animate"))) {
return EL_STR("\xe0\xa4\x95\xe0\xa5\x8b");
}
if (str_eq(gram_case, EL_STR("dative"))) {
return EL_STR("\xe0\xa4\x95\xe0\xa5\x8b");
}
if (str_eq(gram_case, EL_STR("genitive"))) {
return EL_STR("\xe0\xa4\x95\xe0\xa4\xbe");
}
if (str_eq(gram_case, EL_STR("locative_in"))) {
return EL_STR("\xe0\xa4\xae\xe0\xa5\x87\xe0\xa4\x82");
}
if (str_eq(gram_case, EL_STR("locative_on"))) {
return EL_STR("\xe0\xa4\xaa\xe0\xa4\xb0");
}
if (str_eq(gram_case, EL_STR("instrumental"))) {
return EL_STR("\xe0\xa4\xb8\xe0\xa5\x87");
}
if (str_eq(gram_case, EL_STR("ablative"))) {
return EL_STR("\xe0\xa4\xb8\xe0\xa5\x87");
}
if (str_eq(gram_case, EL_STR("comitative"))) {
return EL_STR("\xe0\xa4\x95\xe0\xa5\x87 \xe0\xa4\xb8\xe0\xa4\xbe\xe0\xa4\xa5");
}
if (str_eq(gram_case, EL_STR("benefactive"))) {
return EL_STR("\xe0\xa4\x95\xe0\xa5\x87 \xe0\xa4\xb2\xe0\xa4\xbf\xe0\xa4\x8f");
}
return EL_STR("");
return 0;
}
el_val_t hi_agree_genitive(el_val_t possessed_gender, el_val_t possessed_number) {
if (str_eq(possessed_gender, EL_STR("f"))) {
return EL_STR("\xe0\xa4\x95\xe0\xa5\x80");
}
if (str_eq(possessed_number, EL_STR("pl"))) {
return EL_STR("\xe0\xa4\x95\xe0\xa5\x87");
}
return EL_STR("\xe0\xa4\x95\xe0\xa4\xbe");
return 0;
}
el_val_t hi_verb_stem(el_val_t infinitive) {
if (str_eq(infinitive, EL_STR("\xe0\xa4\xb9\xe0\xa5\x8b\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\xb9\xe0\xa5\x8b");
}
if (str_eq(infinitive, EL_STR("\xe0\xa4\x95\xe0\xa4\xb0\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\x95\xe0\xa4\xb0");
}
if (str_eq(infinitive, EL_STR("\xe0\xa4\x9c\xe0\xa4\xbe\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\x9c\xe0\xa4\xbe");
}
if (str_eq(infinitive, EL_STR("\xe0\xa4\x86\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\x86");
}
if (str_eq(infinitive, EL_STR("\xe0\xa4\xa6\xe0\xa5\x87\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\xa6\xe0\xa5\x87");
}
if (str_eq(infinitive, EL_STR("\xe0\xa4\xb2\xe0\xa5\x87\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\xb2\xe0\xa5\x87");
}
if (str_eq(infinitive, EL_STR("\xe0\xa4\xa6\xe0\xa5\x87\xe0\xa4\x96\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\xa6\xe0\xa5\x87\xe0\xa4\x96");
}
if (str_eq(infinitive, EL_STR("\xe0\xa4\x95\xe0\xa4\xb9\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\x95\xe0\xa4\xb9");
}
if (str_eq(infinitive, EL_STR("\xe0\xa4\x9c\xe0\xa4\xbe\xe0\xa4\xa8\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\x9c\xe0\xa4\xbe\xe0\xa4\xa8");
}
if (str_eq(infinitive, EL_STR("\xe0\xa4\x9a\xe0\xa4\xbe\xe0\xa4\xb9\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\x9a\xe0\xa4\xbe\xe0\xa4\xb9");
}
if (str_eq(infinitive, EL_STR("\xe0\xa4\x96\xe0\xa4\xbe\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\x96\xe0\xa4\xbe");
}
if (str_eq(infinitive, EL_STR("\xe0\xa4\xaa\xe0\xa5\x80\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\xaa\xe0\xa5\x80");
}
if (str_eq(infinitive, EL_STR("\xe0\xa4\xb8\xe0\xa5\x8b\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\xb8\xe0\xa5\x8b");
}
if (str_eq(infinitive, EL_STR("\xe0\xa4\xb2\xe0\xa4\xbf\xe0\xa4\x96\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\xb2\xe0\xa4\xbf\xe0\xa4\x96");
}
if (str_eq(infinitive, EL_STR("\xe0\xa4\xaa\xe0\xa4\xa2\xe0\xa4\xbc\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\xaa\xe0\xa4\xa2\xe0\xa4\xbc");
}
if (str_eq(infinitive, EL_STR("\xe0\xa4\xac\xe0\xa5\x8b\xe0\xa4\xb2\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\xac\xe0\xa5\x8b\xe0\xa4\xb2");
}
if (str_eq(infinitive, EL_STR("\xe0\xa4\x9a\xe0\xa4\xb2\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\x9a\xe0\xa4\xb2");
}
if (str_eq(infinitive, EL_STR("\xe0\xa4\xac\xe0\xa5\x88\xe0\xa4\xa0\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\xac\xe0\xa5\x88\xe0\xa4\xa0");
}
if (str_eq(infinitive, EL_STR("\xe0\xa4\x89\xe0\xa4\xa0\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\x89\xe0\xa4\xa0");
}
if (str_eq(infinitive, EL_STR("\xe0\xa4\xae\xe0\xa4\xbf\xe0\xa4\xb2\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\xae\xe0\xa4\xbf\xe0\xa4\xb2");
}
if (str_eq(infinitive, EL_STR("\xe0\xa4\xb0\xe0\xa4\xb9\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\xb0\xe0\xa4\xb9");
}
if (str_eq(infinitive, EL_STR("\xe0\xa4\xb8\xe0\xa5\x81\xe0\xa4\xa8\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\xb8\xe0\xa5\x81\xe0\xa4\xa8");
}
if (str_eq(infinitive, EL_STR("\xe0\xa4\xb8\xe0\xa4\xae\xe0\xa4\x9d\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\xb8\xe0\xa4\xae\xe0\xa4\x9d");
}
if (str_eq(infinitive, EL_STR("\xe0\xa4\xae\xe0\xa4\xbe\xe0\xa4\xa8\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\xae\xe0\xa4\xbe\xe0\xa4\xa8");
}
if (str_eq(infinitive, EL_STR("\xe0\xa4\xac\xe0\xa4\xa8\xe0\xa4\xbe\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\xac\xe0\xa4\xa8\xe0\xa4\xbe");
}
if (str_eq(infinitive, EL_STR("\xe0\xa4\xb2\xe0\xa4\xbe\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\xb2\xe0\xa4\xbe");
}
if (str_eq(infinitive, EL_STR("\xe0\xa4\xad\xe0\xa5\x87\xe0\xa4\x9c\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\xad\xe0\xa5\x87\xe0\xa4\x9c");
}
if (str_eq(infinitive, EL_STR("\xe0\xa4\x96\xe0\xa5\x8b\xe0\xa4\xb2\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\x96\xe0\xa5\x8b\xe0\xa4\xb2");
}
if (str_eq(infinitive, EL_STR("\xe0\xa4\xac\xe0\xa4\x82\xe0\xa4\xa6 \xe0\xa4\x95\xe0\xa4\xb0\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\xac\xe0\xa4\x82\xe0\xa4\xa6 \xe0\xa4\x95\xe0\xa4\xb0");
}
if (hi_str_ends(infinitive, EL_STR("\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return hi_str_drop_last(infinitive, 1);
}
return infinitive;
return 0;
}
el_val_t hi_verb_stem_clean(el_val_t infinitive) {
if (str_eq(infinitive, EL_STR("\xe0\xa4\xb9\xe0\xa5\x8b\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\xb9\xe0\xa5\x8b");
}
if (str_eq(infinitive, EL_STR("\xe0\xa4\x95\xe0\xa4\xb0\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\x95\xe0\xa4\xb0");
}
if (str_eq(infinitive, EL_STR("\xe0\xa4\x9c\xe0\xa4\xbe\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\x9c\xe0\xa4\xbe");
}
if (str_eq(infinitive, EL_STR("\xe0\xa4\x86\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\x86");
}
if (str_eq(infinitive, EL_STR("\xe0\xa4\xa6\xe0\xa5\x87\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\xa6\xe0\xa5\x87");
}
if (str_eq(infinitive, EL_STR("\xe0\xa4\xb2\xe0\xa5\x87\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\xb2\xe0\xa5\x87");
}
if (str_eq(infinitive, EL_STR("\xe0\xa4\xa6\xe0\xa5\x87\xe0\xa4\x96\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\xa6\xe0\xa5\x87\xe0\xa4\x96");
}
if (str_eq(infinitive, EL_STR("\xe0\xa4\x95\xe0\xa4\xb9\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\x95\xe0\xa4\xb9");
}
if (str_eq(infinitive, EL_STR("\xe0\xa4\x9c\xe0\xa4\xbe\xe0\xa4\xa8\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\x9c\xe0\xa4\xbe\xe0\xa4\xa8");
}
if (str_eq(infinitive, EL_STR("\xe0\xa4\x9a\xe0\xa4\xbe\xe0\xa4\xb9\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\x9a\xe0\xa4\xbe\xe0\xa4\xb9");
}
if (str_eq(infinitive, EL_STR("\xe0\xa4\x96\xe0\xa4\xbe\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\x96\xe0\xa4\xbe");
}
if (str_eq(infinitive, EL_STR("\xe0\xa4\xaa\xe0\xa5\x80\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\xaa\xe0\xa5\x80");
}
if (str_eq(infinitive, EL_STR("\xe0\xa4\xb8\xe0\xa5\x8b\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\xb8\xe0\xa5\x8b");
}
if (str_eq(infinitive, EL_STR("\xe0\xa4\xb2\xe0\xa4\xbf\xe0\xa4\x96\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\xb2\xe0\xa4\xbf\xe0\xa4\x96");
}
if (str_eq(infinitive, EL_STR("\xe0\xa4\xaa\xe0\xa4\xa2\xe0\xa4\xbc\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\xaa\xe0\xa4\xa2\xe0\xa4\xbc");
}
if (str_eq(infinitive, EL_STR("\xe0\xa4\xac\xe0\xa5\x8b\xe0\xa4\xb2\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\xac\xe0\xa5\x8b\xe0\xa4\xb2");
}
if (str_eq(infinitive, EL_STR("\xe0\xa4\x9a\xe0\xa4\xb2\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\x9a\xe0\xa4\xb2");
}
if (str_eq(infinitive, EL_STR("\xe0\xa4\xac\xe0\xa5\x88\xe0\xa4\xa0\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\xac\xe0\xa5\x88\xe0\xa4\xa0");
}
if (str_eq(infinitive, EL_STR("\xe0\xa4\x89\xe0\xa4\xa0\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\x89\xe0\xa4\xa0");
}
if (str_eq(infinitive, EL_STR("\xe0\xa4\xae\xe0\xa4\xbf\xe0\xa4\xb2\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\xae\xe0\xa4\xbf\xe0\xa4\xb2");
}
if (str_eq(infinitive, EL_STR("\xe0\xa4\xb0\xe0\xa4\xb9\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\xb0\xe0\xa4\xb9");
}
if (str_eq(infinitive, EL_STR("\xe0\xa4\xb8\xe0\xa5\x81\xe0\xa4\xa8\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\xb8\xe0\xa5\x81\xe0\xa4\xa8");
}
if (str_eq(infinitive, EL_STR("\xe0\xa4\xb8\xe0\xa4\xae\xe0\xa4\x9d\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\xb8\xe0\xa4\xae\xe0\xa4\x9d");
}
if (str_eq(infinitive, EL_STR("\xe0\xa4\xae\xe0\xa4\xbe\xe0\xa4\xa8\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\xae\xe0\xa4\xbe\xe0\xa4\xa8");
}
if (str_eq(infinitive, EL_STR("\xe0\xa4\xac\xe0\xa4\xa8\xe0\xa4\xbe\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\xac\xe0\xa4\xa8\xe0\xa4\xbe");
}
if (str_eq(infinitive, EL_STR("\xe0\xa4\xb2\xe0\xa4\xbe\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\xb2\xe0\xa4\xbe");
}
if (str_eq(infinitive, EL_STR("\xe0\xa4\xad\xe0\xa5\x87\xe0\xa4\x9c\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\xad\xe0\xa5\x87\xe0\xa4\x9c");
}
if (str_eq(infinitive, EL_STR("\xe0\xa4\x96\xe0\xa5\x8b\xe0\xa4\xb2\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return EL_STR("\xe0\xa4\x96\xe0\xa5\x8b\xe0\xa4\xb2");
}
if (hi_str_ends(infinitive, EL_STR("\xe0\xa4\xa8\xe0\xa4\xbe"))) {
return hi_str_drop_last(infinitive, 2);
}
return infinitive;
return 0;
}
el_val_t hi_present_aspect(el_val_t gender, el_val_t number) {
if (str_eq(gender, EL_STR("f"))) {
return EL_STR("\xe0\xa4\xa4\xe0\xa5\x80");
}
if (str_eq(number, EL_STR("pl"))) {
return EL_STR("\xe0\xa4\xa4\xe0\xa5\x87");
}
return EL_STR("\xe0\xa4\xa4\xe0\xa4\xbe");
return 0;
}
el_val_t hi_aux_present(el_val_t person, el_val_t number) {
if (str_eq(person, EL_STR("1"))) {
if (str_eq(number, EL_STR("sg"))) {
return EL_STR("\xe0\xa4\xb9\xe0\xa5\x82\xe0\xa4\x81");
}
return EL_STR("\xe0\xa4\xb9\xe0\xa5\x88\xe0\xa4\x82");
}
if (str_eq(person, EL_STR("2"))) {
if (str_eq(number, EL_STR("sg"))) {
return EL_STR("\xe0\xa4\xb9\xe0\xa5\x8b");
}
return EL_STR("\xe0\xa4\xb9\xe0\xa5\x8b");
}
if (str_eq(number, EL_STR("sg"))) {
return EL_STR("\xe0\xa4\xb9\xe0\xa5\x88");
}
return EL_STR("\xe0\xa4\xb9\xe0\xa5\x88\xe0\xa4\x82");
return 0;
}
el_val_t hi_past_suffix(el_val_t gender, el_val_t number) {
if (str_eq(gender, EL_STR("m"))) {
if (str_eq(number, EL_STR("sg"))) {
return EL_STR("\xe0\xa4\x86");
}
return EL_STR("\xe0\xa4\x8f");
}
if (str_eq(number, EL_STR("sg"))) {
return EL_STR("\xe0\xa4\x88");
}
return EL_STR("\xe0\xa4\x88\xe0\xa4\x82");
return 0;
}
el_val_t hi_past_irregular(el_val_t stem, el_val_t gender, el_val_t number) {
if (str_eq(stem, EL_STR("\xe0\xa4\xb9\xe0\xa5\x8b"))) {
if (str_eq(gender, EL_STR("m"))) {
if (str_eq(number, EL_STR("sg"))) {
return EL_STR("\xe0\xa4\xa5\xe0\xa4\xbe");
}
return EL_STR("\xe0\xa4\xa5\xe0\xa5\x87");
}
if (str_eq(number, EL_STR("sg"))) {
return EL_STR("\xe0\xa4\xa5\xe0\xa5\x80");
}
return EL_STR("\xe0\xa4\xa5\xe0\xa5\x80\xe0\xa4\x82");
}
if (str_eq(stem, EL_STR("\xe0\xa4\x9c\xe0\xa4\xbe"))) {
if (str_eq(gender, EL_STR("m"))) {
if (str_eq(number, EL_STR("sg"))) {
return EL_STR("\xe0\xa4\x97\xe0\xa4\xaf\xe0\xa4\xbe");
}
return EL_STR("\xe0\xa4\x97\xe0\xa4\x8f");
}
if (str_eq(number, EL_STR("sg"))) {
return EL_STR("\xe0\xa4\x97\xe0\xa4\x88");
}
return EL_STR("\xe0\xa4\x97\xe0\xa4\x88\xe0\xa4\x82");
}
if (str_eq(stem, EL_STR("\xe0\xa4\x95\xe0\xa4\xb0"))) {
if (str_eq(gender, EL_STR("m"))) {
if (str_eq(number, EL_STR("sg"))) {
return EL_STR("\xe0\xa4\x95\xe0\xa4\xbf\xe0\xa4\xaf\xe0\xa4\xbe");
}
return EL_STR("\xe0\xa4\x95\xe0\xa4\xbf\xe0\xa4\x8f");
}
if (str_eq(number, EL_STR("sg"))) {
return EL_STR("\xe0\xa4\x95\xe0\xa5\x80");
}
return EL_STR("\xe0\xa4\x95\xe0\xa5\x80\xe0\xa4\x82");
}
if (str_eq(stem, EL_STR("\xe0\xa4\xa6\xe0\xa5\x87"))) {
if (str_eq(gender, EL_STR("m"))) {
if (str_eq(number, EL_STR("sg"))) {
return EL_STR("\xe0\xa4\xa6\xe0\xa4\xbf\xe0\xa4\xaf\xe0\xa4\xbe");
}
return EL_STR("\xe0\xa4\xa6\xe0\xa4\xbf\xe0\xa4\x8f");
}
if (str_eq(number, EL_STR("sg"))) {
return EL_STR("\xe0\xa4\xa6\xe0\xa5\x80");
}
return EL_STR("\xe0\xa4\xa6\xe0\xa5\x80\xe0\xa4\x82");
}
if (str_eq(stem, EL_STR("\xe0\xa4\xb2\xe0\xa5\x87"))) {
if (str_eq(gender, EL_STR("m"))) {
if (str_eq(number, EL_STR("sg"))) {
return EL_STR("\xe0\xa4\xb2\xe0\xa4\xbf\xe0\xa4\xaf\xe0\xa4\xbe");
}
return EL_STR("\xe0\xa4\xb2\xe0\xa4\xbf\xe0\xa4\x8f");
}
if (str_eq(number, EL_STR("sg"))) {
return EL_STR("\xe0\xa4\xb2\xe0\xa5\x80");
}
return EL_STR("\xe0\xa4\xb2\xe0\xa5\x80\xe0\xa4\x82");
}
if (str_eq(stem, EL_STR("\xe0\xa4\x86"))) {
if (str_eq(gender, EL_STR("m"))) {
if (str_eq(number, EL_STR("sg"))) {
return EL_STR("\xe0\xa4\x86\xe0\xa4\xaf\xe0\xa4\xbe");
}
return EL_STR("\xe0\xa4\x86\xe0\xa4\x8f");
}
if (str_eq(number, EL_STR("sg"))) {
return EL_STR("\xe0\xa4\x86\xe0\xa4\x88");
}
return EL_STR("\xe0\xa4\x86\xe0\xa4\x88\xe0\xa4\x82");
}
if (str_eq(stem, EL_STR("\xe0\xa4\x96\xe0\xa4\xbe"))) {
if (str_eq(gender, EL_STR("m"))) {
if (str_eq(number, EL_STR("sg"))) {
return EL_STR("\xe0\xa4\x96\xe0\xa4\xbe\xe0\xa4\xaf\xe0\xa4\xbe");
}
return EL_STR("\xe0\xa4\x96\xe0\xa4\xbe\xe0\xa4\x8f");
}
if (str_eq(number, EL_STR("sg"))) {
return EL_STR("\xe0\xa4\x96\xe0\xa4\xbe\xe0\xa4\x88");
}
return EL_STR("\xe0\xa4\x96\xe0\xa4\xbe\xe0\xa4\x88\xe0\xa4\x82");
}
if (str_eq(stem, EL_STR("\xe0\xa4\xaa\xe0\xa5\x80"))) {
if (str_eq(gender, EL_STR("m"))) {
if (str_eq(number, EL_STR("sg"))) {
return EL_STR("\xe0\xa4\xaa\xe0\xa4\xbf\xe0\xa4\xaf\xe0\xa4\xbe");
}
return EL_STR("\xe0\xa4\xaa\xe0\xa4\xbf\xe0\xa4\x8f");
}
if (str_eq(number, EL_STR("sg"))) {
return EL_STR("\xe0\xa4\xaa\xe0\xa5\x80");
}
return EL_STR("\xe0\xa4\xaa\xe0\xa5\x80\xe0\xa4\x82");
}
return EL_STR("");
return 0;
}
el_val_t hi_future_suffix(el_val_t person, el_val_t number, el_val_t gender) {
if (str_eq(person, EL_STR("1"))) {
if (str_eq(number, EL_STR("sg"))) {
if (str_eq(gender, EL_STR("f"))) {
return EL_STR("\xe0\xa4\x8a\xe0\xa4\x81\xe0\xa4\x97\xe0\xa5\x80");
}
return EL_STR("\xe0\xa4\x8a\xe0\xa4\x81\xe0\xa4\x97\xe0\xa4\xbe");
}
if (str_eq(gender, EL_STR("f"))) {
return EL_STR("\xe0\xa4\x8f\xe0\xa4\x82\xe0\xa4\x97\xe0\xa5\x80");
}
return EL_STR("\xe0\xa4\x8f\xe0\xa4\x82\xe0\xa4\x97\xe0\xa5\x87");
}
if (str_eq(person, EL_STR("2"))) {
if (str_eq(gender, EL_STR("f"))) {
return EL_STR("\xe0\xa4\x93\xe0\xa4\x97\xe0\xa5\x80");
}
return EL_STR("\xe0\xa4\x93\xe0\xa4\x97\xe0\xa5\x87");
}
if (str_eq(number, EL_STR("sg"))) {
if (str_eq(gender, EL_STR("f"))) {
return EL_STR("\xe0\xa4\x8f\xe0\xa4\x97\xe0\xa5\x80");
}
return EL_STR("\xe0\xa4\x8f\xe0\xa4\x97\xe0\xa4\xbe");
}
if (str_eq(gender, EL_STR("f"))) {
return EL_STR("\xe0\xa4\x8f\xe0\xa4\x82\xe0\xa4\x97\xe0\xa5\x80");
}
return EL_STR("\xe0\xa4\x8f\xe0\xa4\x82\xe0\xa4\x97\xe0\xa5\x87");
return 0;
}
el_val_t hi_tense_suffix(el_val_t tense, el_val_t gender, el_val_t number) {
if (str_eq(tense, EL_STR("present"))) {
return hi_present_aspect(gender, number);
}
if (str_eq(tense, EL_STR("past"))) {
return hi_past_suffix(gender, number);
}
return EL_STR("");
return 0;
}
el_val_t hi_hona_present(el_val_t person, el_val_t number) {
return hi_aux_present(person, number);
return 0;
}
el_val_t hi_hona_past(el_val_t gender, el_val_t number) {
if (str_eq(gender, EL_STR("m"))) {
if (str_eq(number, EL_STR("sg"))) {
return EL_STR("\xe0\xa4\xa5\xe0\xa4\xbe");
}
return EL_STR("\xe0\xa4\xa5\xe0\xa5\x87");
}
if (str_eq(number, EL_STR("sg"))) {
return EL_STR("\xe0\xa4\xa5\xe0\xa5\x80");
}
return EL_STR("\xe0\xa4\xa5\xe0\xa5\x80\xe0\xa4\x82");
return 0;
}
el_val_t hi_conjugate(el_val_t verb, el_val_t tense, el_val_t person, el_val_t gender, el_val_t number) {
el_val_t stem = hi_verb_stem_clean(verb);
if (str_eq(verb, EL_STR("\xe0\xa4\xb9\xe0\xa5\x8b\xe0\xa4\xa8\xe0\xa4\xbe"))) {
if (str_eq(tense, EL_STR("present"))) {
return hi_hona_present(person, number);
}
if (str_eq(tense, EL_STR("past"))) {
return hi_hona_past(gender, number);
}
return el_str_concat(EL_STR("\xe0\xa4\xb9\xe0\xa5\x8b"), hi_future_suffix(person, number, gender));
}
if (str_eq(tense, EL_STR("present"))) {
el_val_t aspect = hi_present_aspect(gender, number);
el_val_t aux = hi_aux_present(person, number);
return el_str_concat(el_str_concat(el_str_concat(stem, aspect), EL_STR(" ")), aux);
}
if (str_eq(tense, EL_STR("past"))) {
el_val_t irreg = hi_past_irregular(stem, gender, number);
if (!str_eq(irreg, EL_STR(""))) {
return irreg;
}
return el_str_concat(stem, hi_past_suffix(gender, number));
}
if (str_eq(tense, EL_STR("future"))) {
return el_str_concat(stem, hi_future_suffix(person, number, gender));
}
return verb;
return 0;
}
el_val_t hi_noun_with_post(el_val_t noun, el_val_t gender, el_val_t number, el_val_t gram_case) {
el_val_t post = hi_postposition(gram_case);
if (str_eq(post, EL_STR(""))) {
return hi_noun_direct(noun, gender, number);
}
el_val_t oblique = hi_noun_oblique(noun, gender, number);
return el_str_concat(el_str_concat(oblique, EL_STR(" ")), post);
return 0;
}
el_val_t hi_genitive_phrase(el_val_t possessor, el_val_t possessor_gender, el_val_t possessor_number, el_val_t possessed, el_val_t possessed_gender, el_val_t possessed_number) {
el_val_t obl = hi_noun_oblique(possessor, possessor_gender, possessor_number);
el_val_t gen = hi_agree_genitive(possessed_gender, possessed_number);
el_val_t poss = hi_noun_direct(possessed, possessed_gender, possessed_number);
return el_str_concat(el_str_concat(el_str_concat(el_str_concat(obl, EL_STR(" ")), gen), EL_STR(" ")), poss);
return 0;
}