示例#1
0
def create_present_active_participle_arch(_, root, pres_conjugation):

    arch_pres_part_act = ''
    if pres_conjugation == 'con1_act':
        if root + 'ων' in greek_corpus and root + 'ουσα' in greek_corpus:
            arch_pres_part_act = root + 'ων/' + root + 'ουσα/' + root + 'ον'

    elif pres_conjugation in ['con2a_act', 'con2ab_act']:
        if root + 'ών' in greek_corpus and root + 'ώσα' in greek_corpus:
            arch_pres_part_act = root + 'ών/' + root + 'ώσα/' + root + 'ών'

    elif pres_conjugation in ['con2b_act', 'con2d_act']:
        if root + 'ών' in greek_corpus and root + 'ούντα' in greek_corpus:
            arch_pres_part_act = root + 'ών/' + root + 'ούσα/' + root + 'ούν'

    elif pres_conjugation == 'con2c_act':
        if root + 'γων' in greek_corpus and root + 'γοντα' in greek_corpus:
            arch_pres_part_act = root + 'γων/' + root + 'γουσα/' + root + 'γον'

    elif pres_conjugation == 'eimai':

        if root + 'ων' in greek_corpus and \
                root + 'όντα' in greek_corpus:
            masc = put_accent_on_the_ultimate(root + 'ων', accent_one_syllable=False)
            fem = put_accent_on_the_penultimate(root + 'ούσα')
            neut = put_accent_on_the_ultimate(root + 'ον', accent_one_syllable=False)

            arch_pres_part_act = masc + '/' + fem + '/' + neut

    return arch_pres_part_act
示例#2
0
def create_active_aorist_participle(root, act_roots):
    """
    :param root:
    :param act_roots: can be multiple alternative forms separated by ','
    :return:
    """
    result = []
    for act_root in act_roots.split(','):
        active_aorist_participles = None
        masc = act_root + 'ας'
        fem = act_root + 'ασα'
        neut = act_root + 'αν'

        masc_wn = put_accent_on_the_ultimate(act_root + 'ων')
        fem_ousa = put_accent_on_the_penultimate(act_root + 'ουσα')
        neut_on = put_accent_on_the_ultimate(act_root + 'ον')
        if masc in greek_corpus and fem in greek_corpus:
            active_aorist_participles = masc + '/' + fem + '/' + neut
            # on as
        elif masc_wn in greek_corpus and fem_ousa in greek_corpus:
            active_aorist_participles = masc_wn + '/' + fem_ousa + '/' + neut_on

        if active_aorist_participles:
            result.append(active_aorist_participles)

    return ','.join(result)
示例#3
0
def alternative_forms_wn(adj):
    # wn, ousa on
    alt_forms = copy.deepcopy(adj_basic_template)

    masc, fem, neut = adj.split('/')

    if neut != '-':
        thema = neut + 'τ'
        alt_forms['sg']['masc']['acc'] = thema + 'α'
        alt_forms['sg']['masc']['gen'] = thema + 'ος'
        alt_forms['sg']['neut']['nom'] = neut
        alt_forms['sg']['neut']['gen'] = thema + 'ος'
        alt_forms['sg']['neut']['acc'] = neut
        alt_forms['sg']['neut']['voc'] = neut
        alt_forms['pl']['masc']['nom'] = thema + 'ες'
        alt_forms['pl']['masc']['acc'] = thema + 'ες'
        alt_forms['pl']['masc']['gen'] = put_accent_on_the_penultimate(thema +
                                                                       'ων')
        alt_forms['pl']['masc']['voc'] = thema + 'ες'
        alt_forms['pl']['neut']['nom'] = thema + 'α'
        alt_forms['pl']['neut']['acc'] = thema + 'α'
        alt_forms['pl']['neut']['gen'] = put_accent_on_the_penultimate(thema +
                                                                       'ων')
        alt_forms['pl']['neut']['voc'] = thema + 'α'
    if masc != '-':
        alt_forms['sg']['masc']['nom'] = masc
        alt_forms['sg']['masc']['voc'] = masc

    if fem != '-':
        alt_forms['sg']['fem']['nom'] = fem
        alt_forms['sg']['fem']['acc'] = fem
        alt_forms['sg']['fem']['gen'] = fem + 'ς'
        alt_forms['sg']['fem']['voc'] = fem
        alt_forms['pl']['fem']['nom'] = fem[:-1] + 'ες'
        alt_forms['pl']['fem']['acc'] = fem[:-1] + 'ες'
        alt_forms['pl']['fem']['gen'] = put_accent_on_the_ultimate(fem[:-1] +
                                                                   'ων')
        alt_forms['pl']['fem']['voc'] = fem[:-1] + 'ες'

    return alt_forms
示例#4
0
def alternative_forms_onas(adj):
    alt_forms = {
        'sg': {
            'masc': {
                'nom': '',
                'gen': '',
                'acc': '',
                'voc': ''
            },
        },
        'pl': {
            'masc': {
                'nom': '',
                'gen': '',
                'acc': '',
                'voc': ''
            },
        }
    }

    masc, fem, neut = adj.split('/')

    if neut:
        thema = neut
        alt_forms['sg']['masc']['acc'] = thema + 'α'
        alt_forms['sg']['masc']['gen'] = thema + 'ος'
        alt_forms['pl']['masc']['nom'] = thema + 'ες'
        alt_forms['pl']['masc']['acc'] = thema + 'ες'
        alt_forms['pl']['masc']['gen'] = put_accent_on_the_penultimate(thema +
                                                                       'ων')
        alt_forms['pl']['masc']['voc'] = thema + 'ες'

    if fem:
        alt_forms['sg']['masc']['nom'] = fem
        alt_forms['sg']['masc']['voc'] = fem

    return alt_forms
示例#5
0
def create_all_num_adj_forms(num_base_forms, ordinal=False):
    """
    :param num_base_forms masc/fem/neut:
    :return: a dictionary of forms (like adj)
    """
    if ordinal:
        all_forms = create_all_adj_forms(num_base_forms)

        return all_forms[0]
    else:
        masc, fem, neut = num_base_forms.split('/')
        forms = copy.deepcopy(adj_basic_template)

        if masc[-2:] in ['οι', 'οί'] and fem[-2:] in [
                'ες', 'ές'
        ] and neut[-1] in ['α', 'ά']:
            # exclusively for numerals, as there are for obvious reasons only in plural
            accent = where_is_accent(masc, true_syllabification=False)
            acc_masc = masc[:-2] + 'ους'
            gen_pl = masc[:-2] + 'ων'
            if accent == 'ultimate':
                acc_masc = put_accent_on_the_ultimate(acc_masc)
                gen_pl = put_accent_on_the_ultimate(gen_pl)
            elif accent == 'antepenultimate':
                accs_masc = [
                    acc_masc,
                    put_accent_on_the_penultimate(acc_masc,
                                                  true_syllabification=False)
                ]
                gens_pl = [
                    gen_pl,
                    put_accent_on_the_penultimate(gen_pl,
                                                  true_syllabification=False)
                ]
                gen_pl = ','.join([g for g in gens_pl if g in greek_corpus])
                acc_masc = ','.join(
                    [a for a in accs_masc if a in greek_corpus])

        elif neut[-4:] == 'τρία':
            gen_pl = neut[:-4] + 'τριών'
            acc_masc = masc

        elif neut[-7:] == 'τέσσερα':
            gen_pl = 'τεσσάρων'
            acc_masc = masc

        elif neut == 'ένα':

            forms['sg']['masc']['nom'] = masc
            forms['sg']['masc']['acc'] = 'ένα,έναν'
            forms['sg']['masc']['voc'] = 'ένα'
            forms['sg']['masc']['gen'] = 'ενός'

            forms['sg']['fem']['nom'] = 'μια,μία'
            forms['sg']['fem']['acc'] = 'μια,μιαν,μία,μίαν'
            forms['sg']['fem']['gen'] = 'μίας,μιας'
            forms['sg']['fem']['voc'] = 'μία,μια'

            forms['sg']['neut']['gen'] = 'ενός'
            forms['sg']['neut']['nom'] = neut
            forms['sg']['neut']['acc'] = neut
            forms['sg']['neut']['voc'] = neut

            return forms

        elif masc == 'ενάμισης':

            forms['sg']['masc']['nom'] = masc
            forms['sg']['masc']['acc'] = masc[:-1]
            forms['sg']['masc']['voc'] = masc[:-1]
            forms['sg']['masc']['gen'] = masc[:-1]

            forms['sg']['fem']['nom'] = fem
            forms['sg']['fem']['acc'] = fem
            forms['sg']['fem']['gen'] = fem + 'ς'
            forms['sg']['fem']['voc'] = fem

            forms['sg']['neut']['gen'] = neut
            forms['sg']['neut']['nom'] = neut
            forms['sg']['neut']['acc'] = neut
            forms['sg']['neut']['voc'] = neut

            return forms

        elif neut == 'μηδέν':
            masc = 'μηδείς'
            fem = 'μηδεμία'

            forms['sg']['masc']['nom'] = masc
            forms['sg']['masc']['acc'] = 'μηδένα'
            forms['sg']['masc']['gen'] = 'μηδενός'

            forms['sg']['neut']['nom'] = neut
            forms['sg']['neut']['gen'] = 'μηδενός'
            forms['sg']['neut']['acc'] = neut

            forms['sg']['fem']['nom'] = fem
            forms['sg']['fem']['acc'] = fem + ',μηδεμίαν'
            forms['sg']['fem']['gen'] = 'μηδεμίας'
            forms['sg']['fem']['voc'] = fem

            return forms

        else:
            masc = fem = neut = acc_masc = gen_pl = neut

        forms['pl']['masc']['nom'] = masc
        forms['pl']['masc']['acc'] = acc_masc
        forms['pl']['masc']['gen'] = gen_pl
        forms['pl']['masc']['voc'] = masc

        forms['pl']['fem']['nom'] = fem
        forms['pl']['fem']['acc'] = fem
        forms['pl']['fem']['gen'] = gen_pl
        forms['pl']['fem']['voc'] = fem

        forms['pl']['neut']['nom'] = neut
        forms['pl']['neut']['acc'] = neut
        forms['pl']['neut']['gen'] = gen_pl
        forms['pl']['neut']['voc'] = neut

        return forms
def create_all_basic_adj_forms(adj, inflection=None):
    """
    :param inflection: if relevant, add 'aklito' flag if it is certain does not have any declination (like μωβ)
    :param adj: masc nom sg form (`ωραίος`)
    :return: dictionary with keys:
    'adj': masc, fem, neut forms as a string divided with / ('ωραίος/ωραία/ωραίο') if alternatives, they are added and
    separated with a coma
    'comparative': if exists in form parathetiko + ',' + alt_parathetiko + '/' + uperthetiko + ',' + alt_uperthetiko with
    form only in masc sing nom
    'adverb': adverb form, if alternatives, then separated with coma
    'adverb_comparative': if exists, adverb_parathetiko + ',' + alt_adverb_parathetiko + '/' + adverb_uperthetiko + ',' + alt_adverb_uperthetiko
    """



    if adj[-2:] == 'ον' and adj + 'τα' in greek_corpus:
        adj = adj[:-2] + 'ων'

    elif adj[-2:] == 'ές' and adj[:-2] + 'ής' in greek_corpus:
        #  ['εκκρεμές', 'λυκαυγές', 'αλκαλοειδές']:
        adj = adj[:-2] + 'ής'
    elif adj[-2:] == 'έν' and adj[:-2] + 'είς' in greek_corpus:
        # ['ανακοινωθέν']:
        adj = adj[:-2] + 'είς'
    elif adj[-2:] == 'ού':
        if adj[:-2] + 'άς' in greek_corpus:
            adj = adj[:-2] + 'άς'
        elif put_accent_on_the_penultimate(adj[:-2] + 'ης') in greek_corpus:
            adj = put_accent_on_the_penultimate(adj[:-2] + 'ης')
    elif adj[-1] == 'ί' and adj[:-1] + 'ής' in greek_corpus:
        adj = adj[:-1] + 'ής'
    accent = where_is_accent(adj, true_syllabification=False)

    adj_temp = {'adj': 'masc,fem,neuter', 'comparative': '', 'adverb': '', 'adverb_comparative': ''}

    adj_forms = []
    # most basic case -os

    if adj[-2:] in ['ός', 'ος']:
        masc = adj
        adj_forms.append(masc)

        if accent == 'ultimate':
            fem = adj[:-2] + 'ή'
        else:
            fem = adj[:-2] + 'η'

        if adj[-3] in vowels and count_syllables(adj) <= 2:
            if accent == 'ultimate':
                fem = adj[:-2] + 'ά'
            else:
                fem = adj[:-2] + 'α'

        elif adj[-3] in vowels and count_syllables(adj) > 2 and not is_accented(modern_greek_syllabify(adj)[-3]):
            if accent == 'ultimate':
                fem = adj[:-2] + 'ά'
            else:
                fem = adj[:-2] + 'α'

        if adj[-3] in ['κ', 'θ', 'χ']:

            if accent == 'ultimate':
                fem_alt = adj[:-2] + 'ιά'
            else:
                fem_alt = adj[:-2] + 'ια'

            if fem in greek_corpus and fem_alt in greek_corpus:
                fem = fem + ',' + fem_alt

            elif fem not in greek_corpus and fem_alt in greek_corpus:
                fem = fem_alt

            elif fem in greek_corpus and fem_alt not in greek_corpus:
                fem = fem
            else:
                # for the most part forms on h should be correct, but adj is not very common, so is lacking from db
                # check for -a by looking for genitive on as in db
                if accent == 'ultimate':
                    gen = adj[:-2] + 'άς'
                    beta_fem = adj[:-2] + 'ά'
                else:
                    gen = adj[:-2] + 'ας'
                    beta_fem = adj[:-2] + 'α'

                if gen in greek_corpus:
                    fem = beta_fem

            # if it's lacking from the db, still the best guess is to leave the form on -h

        adj_forms.append(fem)

        neuter = adj[:-1]

        adj_forms.append(neuter)

    elif adj[-2:] in ['ής', 'ης']:

        # first check which type
        stem = adj[:-2]
        if stem + 'ικο' in greek_corpus:
            # type hs, a, iko, here accent is always on the last syllable of the stem
            masc = adj
            fem = stem + 'α'
            if stem + 'ισσα' in greek_corpus:
                fem = stem + 'ισσα'
            neuter = stem + 'ικο'

        elif where_is_accent(adj) == 'ultimate' and (stem + 'ὶ' in greek_corpus or stem + 'ιά' in greek_corpus):
            # type, hs, ia, i, mostly colors

            masc = adj
            fem = put_accent(stem + 'ια', accent)
            neuter = put_accent(stem + 'ι', accent)

        elif put_accent(stem + 'ους', accent, true_syllabification=False) in greek_corpus:
            # type hs, hs, es
            masc, fem = adj, adj
            neuter = put_accent(stem + 'ες', accent, true_syllabification=False)
            if accent != 'ultimate' and neuter not in greek_corpus:
                neuter = put_accent(stem + 'ες', 'antepenultimate', true_syllabification=False)

        elif stem + 'ού' in greek_corpus:
            # type kafetzhs kafetzou, but is it a adj?
            masc = adj
            fem = adj[:-2] + 'ού'
            neuter = adj[:-1] + 'δικο'

        else:
            """
            In cases where my corpus cannot help me, I will surmise that it's hs, a (or issa), iko
            """

            if accent == 'penultimate':
                if adj.endswith('ώδης'):
                    masc, fem = adj, adj
                    neuter = stem + 'ες'
                else:
                    masc = adj
                    fem = stem + 'α'
                    if stem + 'ισσα' in greek_corpus:
                        fem = stem + 'ισσα'
                    neuter = stem + 'ικο'
            elif accent == 'ultimate':
                masc, fem = adj, adj
                neuter = stem + 'ές'

    elif adj[-3:] == 'ους':
        masc, fem = adj, adj
        neuter = adj[:-1] + 'ν'

    elif adj[-2:] in ['υς', 'ύς'] or adj in ['γλυκύ']:
        # my database is unfortunately not that great...
        stem = adj[:-2]
        masc = adj
        neuter = adj[:-1]
        if adj in ['γλυκύ']:
            # unfortunately there are some mistakes in my word list wherever forms are given as lemma
            # and so I have to correct them in this way
            stem = adj[:-1]
            masc = adj + 'ς'
            neuter = adj

        fem = stem + 'ιά'

        if fem + 'ς' not in greek_corpus:
            # look for gen because nom fem can be mistaken for acc pl
            fem_eia = stem + 'εία'
            if fem_eia in greek_corpus:
                fem = fem_eia
            if adj[-5:] == 'πολύς':
                fem = adj[:-5] + 'πολλή'

    elif adj[-2:] in ['ων', 'ών']:
        stem = adj[:-2]
        masc = adj
        fem = None
        neuter = None
        if accent == 'penultimate' or not accent:
            fem = stem + 'ουσα'

            neuter = stem + 'ον'

        if accent == 'ultimate' or not accent:
            fem = stem + 'ούσα'
            neuter = stem + 'ούν'
            neuter_alt_1 = stem + 'ών'
            neuter_alt_2 = stem + 'ούν'
            if neuter + 'τα' in greek_corpus or neuter + 'τες' in greek_corpus:
                fem = stem + 'ούσα'
            elif neuter_alt_1 + 'τα' in greek_corpus or neuter_alt_1 + 'τες' in greek_corpus or adj in ['ζων',
                                                                                                        'κυβερνών',
                                                                                                        'επιζών']:

                fem = stem + 'ώσα'
                neuter = neuter_alt_1
            elif neuter_alt_2 + 'τα' in greek_corpus or neuter_alt_2 + 'τες' in greek_corpus or neuter_alt_2 + 'των' in greek_corpus:
                fem = stem + 'ούσα'
                neuter = neuter_alt_2
            if not accent:
                neuter = remove_all_diacritics(neuter)

        # it is also possible, that there are wn, onos
        if adj[:-2] + 'ονος' in greek_corpus:
            masc, fem = adj, adj
            neuter = adj[:-2] + 'ον'

    elif adj[-3:] == 'είς':
        # passive aorist participles
        if not adj[:-3] + 'έντα' in greek_corpus:
            raise NotLegalAdjectiveException
        masc = adj
        fem = adj[:-1] + 'σα'
        neuter = adj[:-3] + 'έν'

    elif adj[-2:] in ['ας', 'άς']:

        # pas, pasa pan and active aorist participles
        # pas pasa pan

        pl_nta = adj[:-1] + 'ντα'
        fem_sa = adj[:-1] + 'σα'

        if count_syllables(adj) == 1:
            pl_nta = put_accent(pl_nta, 'penultimate')
            fem_sa = put_accent(fem_sa, 'penultimate')
        if pl_nta in greek_corpus:
            masc = adj
            fem = fem_sa
            neuter = adj[:-1] + 'ν'

        elif adj in ['μέλας']:
            masc = adj
            fem = adj[:-2] + 'αινα'
            neuter = adj[:-1] + 'ν'

        elif adj == 'μέγας':
            masc = adj
            fem = 'μαγάλη'
            neuter = 'μέγα'

        elif adj[-4:] == 'ονας':
            masc = adj
            fem = adj[:-4] + 'ων'
            neuter = adj[:-2]

        elif where_is_accent(adj) == 'ultimate':
            masc = adj
            fem = adj[:-2] + 'ού'
            neuter = adj[:-1] + 'δικο'
        else:
            raise NotLegalAdjectiveException

    elif adj in ['προβεβηκώς', 'κεχηνώς', 'τεθνεώς', 'αφεστώς', 'ἐνεστώς']:
        masc = adj
        fem = adj[:-1] + 'σα'
        neuter = adj
        # rare but sometimes ancient perf participle

    elif adj in ['άρρην']:
        # so rare that it can be solved like that
        masc = adj
        fem = adj
        neuter = masc[:-2] + 'εν'

    elif adj in ['περίφροντις', 'φέρελπις', 'άφροντις', 'φιλόπατρις', 'μόνορχις', 'παλίμπαις', 'πολύφροντις',
                 'αρνησίπατρις', 'άπολις', 'άπατρις', 'αφιλόπατρις', 'ενήλιξ', 'πυρρόθριξ', 'δασύθριξ', 'ουλόθριξ',
                 'κεντρόφυξ', 'πυρρόθριξ', 'υπερήλιξ', 'βλαξ', 'ομήλιξ', 'υπερμέτρωψ', 'κεντρόφυξ', 'μεσήλιξ']:
        masc, fem = adj, adj
        neuter = '-'

    elif adj in ['εύχαρις', 'επίχαρις', 'άχαρις']:
        masc, fem = adj, adj
        neuter = adj[:-1]

    elif adj in ['ίλεως']:
        masc, fem = adj, adj
        neuter = adj[:-1] + 'ν'

    else:
        masc, fem, neuter = adj, adj, adj

    if inflection == 'aklito':
        masc, fem, neuter = adj, adj, adj

    adj_forms = [masc, fem, neuter]

    adj_temp['adj'] = '/'.join(adj_forms)

    # παραθετικά

    stem = neuter
    if stem[-1] == 'ς':
        stem = stem[:-1] + 'σ'
    parathetika = None
    alt_parathetiko = None
    uperthetiko = '-'
    alt_uperthetiko = None

    parathetiko = put_accent_on_the_antepenultimate(stem + 'τερος')

    if parathetiko not in greek_corpus:
        parathetiko = None
    else:
        uperthetiko = put_accent_on_the_antepenultimate(parathetiko[:-5] + 'τατος')

        if uperthetiko not in greek_corpus:
            uperthetiko = '-'

    if neuter[-1] in ['ο', 'ό']:
        alt_parathetiko = remove_all_diacritics(neuter[:-1]) + 'ύτερος'
        if alt_parathetiko not in greek_corpus:
            alt_parathetiko = None
        else:
            alt_uperthetiko = put_accent_on_the_antepenultimate(alt_parathetiko[:-5] + 'τατος')
            if alt_uperthetiko not in greek_corpus:
                alt_uperthetiko = '-'

    if parathetiko and alt_parathetiko:
        parathetika = parathetiko + ',' + alt_parathetiko + '/' + uperthetiko + ',' + alt_uperthetiko

    elif parathetiko:
        parathetika = parathetiko + '/' + uperthetiko

    elif alt_parathetiko and alt_uperthetiko:
        parathetika = alt_parathetiko + '/' + alt_uperthetiko

    if neuter in irregular_comparatives.keys():
        parathetiko = irregular_comparatives[neuter].split('/')[0]
        uperthetiko = irregular_comparatives[neuter].split('/')[1]
        alt_parathetiko, alt_uperthetiko = None, None
        parathetika = irregular_comparatives[neuter]

    if parathetika:
        adj_temp['comparative'] = parathetika

    # επιρρήματα

    alt_adv = None

    if neuter[-1] in ['ο', 'ό']:
        accent = where_is_accent(neuter)
        if accent != 'ultimate':
            adverb = neuter[:-1] + 'α'
            alt_adv = put_accent_on_the_penultimate(neuter[:-1] + 'ως', true_syllabification=False)
        else:
            adverb = neuter[:-1] + 'ά'
            alt_adv = neuter[:-1] + 'ώς'

    elif masc[-2:] in ['ής', 'ης'] and neuter[-2:] in ['ές', 'ες']:

        adverb = remove_all_diacritics(neuter[:-2]) + 'ώς'
        if adverb not in greek_corpus and neuter[:-2] + 'ως' in greek_corpus:
            adverb = neuter[:-2] + 'ως'
        alt_adv = neuter[:-2] + 'ά'

    elif neuter[-1] in ['υ', 'ύ'] and masc[-1] == 'ς':
        # it should have the ancient form on ews
        adverb = put_accent_on_the_penultimate(neuter[:-1] + 'εως')
        if adverb not in greek_corpus:
            adverb = adj_forms[1]
    elif neuter[-1] == 'ί':
        # colors
        adverb = put_accent_on_the_ultimate(adj_forms[2] + 'α')

    elif (masc[-2:] in ['ας', 'άς', 'ων', 'ών'] or masc[-3:] in ['εις', 'είς']) and fem[-2:] == 'σα' and neuter[
        -1] == 'ν':
        # ancient adverbs
        adverb = put_accent_on_the_penultimate(neuter + 'τως')
    else:
        # for aklita
        adverb = neuter

    if neuter in ['λίγο', 'πολύ', 'ήσσον', 'κάλλιον']:
        adverb = neuter

    # special cases
    if neuter in ['μέγα', 'μεγάλο']:
        # special case
        adverb = 'μέγα'
        alt_adv = 'μεγάλως'

    elif (masc[-4:] == 'ονας' or masc[-2:] == 'ων') and fem[-2:] == 'ων':
        adverb = None

    elif masc in ['άρρην', 'μέλας']:
        adverb = None

    epirrimata = [e for e in [adverb, alt_adv] if e and e in greek_corpus]

    epirrimata = ','.join(epirrimata)
    if epirrimata:
        adj_temp['adverb'] = epirrimata

    # comparative epirrimata
    adv_parathetika = None

    adverb_parathetiko = alt_adverb_parathetiko = adverb_uperthetiko = alt_adverb_uperthetiko = ''

    if parathetiko:
        adverb_parathetiko = parathetiko[:-2] + 'α'
        if uperthetiko != '-':
            adverb_uperthetiko = ','.join([yp[:-2] + 'α' for yp in uperthetiko.split(',')])
        else:
            adverb_uperthetiko = '-'

    if alt_parathetiko:
        alt_adverb_parathetiko = alt_parathetiko[:-2] + 'α'
        if alt_uperthetiko:

            alt_adverb_uperthetiko = alt_uperthetiko[:-2] + 'α'
        else:
            alt_adverb_uperthetiko = '-'

    if parathetiko and alt_parathetiko:
        adv_parathetika = adverb_parathetiko + ',' + alt_adverb_parathetiko + '/' + adverb_uperthetiko + ',' + alt_adverb_uperthetiko

    elif parathetiko:
        adv_parathetika = adverb_parathetiko + '/' + adverb_uperthetiko
    elif alt_parathetiko:
        adv_parathetika = alt_adverb_parathetiko + '/' + alt_adverb_uperthetiko

    if neuter in irregular_comparative_adverbs.keys():
        adv_parathetika = irregular_comparative_adverbs[neuter]

    if adv_parathetika:
        adj_temp['adverb_comparative'] = adv_parathetika

    return adj_temp
示例#7
0
def create_passive_perfect_participle(pres_form, root, act_root, passive_root):

    all_passive_perfect_participles = ''
    passive_perfect_participles = []

    # check for irregularities
    for pr_f in irregular_passive_perfect_participles.keys():

        if pr_f == pres_form[-(len(pr_f)):] and irregular_passive_perfect_participles[pr_f]:

            part = pres_form[:-len(pr_f)] + irregular_passive_perfect_participles[pr_f]
            part_aug = add_augment(part)
            if part in greek_corpus:
                passive_perfect_participles = [part]
            for p in part_aug:
                if p in greek_corpus:
                    passive_perfect_participles.append(p)

    if passive_root and not passive_perfect_participles:

        if passive_root[-2:] == 'νθ':
            passive_perfect_participle = put_accent_on_the_penultimate(passive_root[:-2] + 'σμενος')
        elif passive_root[-2:] == 'στ':
            passive_perfect_participle = put_accent_on_the_penultimate(passive_root[:-1] + 'μενος')
        elif passive_root[-1] == 'θ':
            passive_perfect_participle = put_accent_on_the_penultimate(passive_root[:-1] + 'μενος')
        elif passive_root[-2:] == 'φτ':
            passive_perfect_participle = put_accent_on_the_penultimate(passive_root[:-2] + 'μμενος')
        elif passive_root[-1] == 'φ':
            passive_perfect_participle = put_accent_on_the_penultimate(passive_root[:-1] + 'μμενος')

        elif passive_root[-3:] == 'ευτ':
            passive_perfect_participle = put_accent_on_the_penultimate(passive_root[:-2] + 'μενος')
            if act_root and act_root[-1] == 'σ':
                passive_perfect_participle = put_accent_on_the_penultimate(passive_root[:-1] + 'μενος')
            if passive_perfect_participle not in greek_corpus:
                passive_perfect_participle = put_accent_on_the_penultimate(passive_root[:-1] + 'μενος')
        elif passive_root[-2:] == 'χτ':
            passive_perfect_participle = put_accent_on_the_penultimate(passive_root[:-2] + 'γμενος')
        else:
            passive_perfect_participle = put_accent_on_the_penultimate(passive_root + 'μένος')

        passive_perfect_participles = add_augment(passive_perfect_participle)

        passive_perfect_participles = [f for f in passive_perfect_participles if f in greek_corpus]
        if root[-3:] == 'ποι':
            passive_perfect_participles = [root + 'ημένος']

    elif not passive_root and act_root and not passive_perfect_participles:

        if act_root[-2:] in ['ύσ', 'άσ', 'ίσ']:
            passive_perfect_participle = put_accent_on_the_penultimate(act_root + 'μενος')
        elif act_root[-1] in ['σ', 'ν']:
            passive_perfect_participle = put_accent_on_the_penultimate(act_root[:-1] + 'μενος')
            if passive_perfect_participle not in greek_corpus:
                passive_perfect_participle = put_accent_on_the_penultimate(act_root[:-1] + 'σμενος')
        elif act_root[-1] == 'ξ':
            passive_perfect_participle = put_accent_on_the_penultimate(act_root[:-1] + 'γμενος')
        elif pres_form[-3:] == 'αίν':
            passive_perfect_participle = put_accent_on_the_penultimate(act_root[:-3] + 'ημενος')
            if passive_perfect_participle not in greek_corpus:
                passive_perfect_participle = put_accent_on_the_penultimate(act_root[:-3] + 'αμενος')
        else:
            passive_perfect_participle = put_accent_on_the_penultimate(act_root + 'μενος')
        if passive_perfect_participle:
            passive_perfect_participles = add_augment(passive_perfect_participle)

            passive_perfect_participles = [f for f in passive_perfect_participles if f in greek_corpus]

    if passive_perfect_participles:
        # these are all possible participles in masc sg!!!
        passive_perfect_participles = list(set(passive_perfect_participles))
        all_passive_perfect_participles = ','.join(passive_perfect_participles)

    return all_passive_perfect_participles
示例#8
0
def create_basic_paratatikos_forms(pres_form, root, pres_conjugation, deponens=False, not_deponens=True, modal_act=False, modal_med=False):
    paratatikos_basic_forms = None
    if not_deponens:
        act_par, pass_par = [], []
        if pres_conjugation == 'con1_act':
            not_augmented_par = root + 'α'
            act_par = add_augment(not_augmented_par)

            act_par = [f for f in act_par if not (count_syllables(
                f) == 2 and f[0] not in vowels)]
            pass_par = [put_accent_on_the_penultimate(root + 'όμουν')]

        elif pres_conjugation == 'con2a_act':
            act_par = [root + 'ούσα', put_accent_on_the_antepenultimate(root + 'αγα')]
            pass_par = [root + 'ιόμουν', root + 'άμην']

        elif pres_conjugation in ['con2b_act', 'con2d_act']:
            act_par = [root + 'ούσα']
            pass_par = [root + 'ούμουν']
            if pres_conjugation == 'con2b_act' and root[-1] == 'ι':
                pass_par.append(root + 'όμουν')

        elif pres_conjugation == 'con2c_act':
            not_augmented_par = root + 'γα'
            act_par = add_augment(not_augmented_par)
            pass_par = [put_accent_on_the_penultimate(root + 'γόμουν')]

        elif pres_conjugation == 'eimai':
            act_par = ['ήμουν']

        act_par_all = [f for f in act_par if f in greek_corpus]
        if not act_par_all:

            act_par_all_3rd = [f for f in act_par if f[:-1] + 'ε' in greek_corpus]
            if act_par_all_3rd:
                act_par_all = [f[:-1] + 'α' for f in act_par_all_3rd]

        pass_par = [f for f in pass_par if f in greek_corpus]
        act_par = ','.join(act_par_all)
        pass_par = ','.join(pass_par)

        paratatikos = '/'.join([act_par, pass_par])
        if root[-3:] == 'ποι':
            paratatikos = root + 'ούσα/' + root + 'ούμουν' + ',' + root + 'όμουν'

        paratatikos_basic_forms = paratatikos

    elif deponens:
        pass_par = []
        root = remove_all_diacritics(root)
        if pres_conjugation == 'con1_pass':
            pass_par = [root + 'όμουν']
        elif pres_conjugation == 'con2a_pass':
            pass_par = [root + 'ιόμουν', root + 'ούμουν', root + 'όμουν']
        elif pres_conjugation == 'con2b_pass':
            pass_par = [root + 'ούμουν', root + 'ιόμουν']
        elif pres_conjugation in ['con2c_pass', 'con2ab_pass']:
            pass_par = [root + 'όμουν']
        elif pres_conjugation == 'con2d_pass':
            pass_par = [put_accent_on_the_penultimate(root + 'μην'), root[:-1] + 'όμουν', root + 'όμουν']
            pass_par.extend(add_augment(pass_par[0]))
        elif pres_conjugation == 'con2e_pass':
            pass_par = [root + 'άμην', root + 'όμουν']
        pass_par = [f for f in pass_par if f in greek_corpus]
        pass_par = list(set(pass_par))
        pass_par = ','.join(pass_par)
        if root[-3:] == 'ποι':
            pass_par = root + 'ούμουν,' + root + 'όμουν'
        paratatikos_basic_forms = '/' + pass_par

    elif modal_act:
        parat_act_forms = []
        if pres_form[-3:] == 'άει':
            parat_act_forms = add_augment(pres_form[:-3] + 'ούσε')
            parat_act_forms.extend(add_augment(pres_form[:-3] + 'αγε'))
        elif pres_form[-3:] == 'ά':
            parat_act_forms = add_augment(pres_form[:-1] + 'ούσε')
            parat_act_forms.extend(add_augment(pres_form[:-1] + 'γε'))
        elif pres_form[-2:] == 'ει':
            parat_act_forms = add_augment(pres_form[:-2] + 'ε')
        elif pres_form[-2:] == 'εί':
            parat_act_forms = add_augment(pres_form[:-2] + 'ούσε')

        parat_act_forms = [f for f in parat_act_forms if f in greek_corpus]
        parat_act_forms = ','.join(parat_act_forms)

        paratatikos_basic_forms = parat_act_forms + '/'

    elif modal_med:
        parat_med_forms = ''
        if pres_form[-5:] == 'ιέται':
            parat_med_forms = [root + 'ιόταν']

        elif pres_form[-5:] == 'είται':
            parat_med_forms = add_augment(root + 'είτο')
            parat_med_forms.extend([root + 'ούνταν'])

        elif pres_form[-4:] == 'άται':
            parat_med_forms = [root + 'άτο', root + 'όταν', root + 'ιόταν']

        elif pres_form[-4:] == 'εται':
            parat_med_forms = [put_accent_on_the_penultimate(root + 'όταν'), root + 'ετο']
        elif pres_form[-5:] == 'ειται':
            parat_med_forms = [root + 'ειτο']
            parat_med_forms.extend(add_augment(parat_med_forms[0]))
            parat_med_forms = [put_accent_on_the_antepenultimate(v) for v in parat_med_forms]

        parat_med_forms = [f for f in parat_med_forms if f in greek_corpus]
        parat_med_forms = ','.join(parat_med_forms)
        paratatikos_basic_forms = '/' + parat_med_forms

    return paratatikos_basic_forms
示例#9
0
def create_all_basic_noun_forms(noun, inflection=None, gender=None, proper_name=False):
    """
    :param proper_name: Proper names behave differently from normal nouns, so if it is known, it should be flagged
    :param gender: In case of some nouns, gender should be given, where it cannot be correctly guessed on the basis
    of the ending
    :param inflection: It can have value None (then inflection is found automatically, or "aklito" (indeclinable)
    :param noun: must be nom sg
    :return: dictionary with keys: nom_sg, gen_sg, nom_pl and gender. Alternative forms are divided with coma
    """

    noun_temp ={'nom_sg': noun, 'gen_sg': '', 'nom_pl': '', 'gender': ''}
    number_of_syllables = count_syllables(noun, true_syllabification=False)
    accent = where_is_accent(noun, true_syllabification=False)
    ultimate_accent = accent == ULTIMATE

    capital = noun[0].isupper()
    noun = noun.lower()

    prefixes = ['νανο', 'μικρο', 'σκατο', 'παλιο']

    # on 'os'

    if noun[-2:] in ['ός', 'ος']:
        stem = noun[:-2]
        plural_form = put_accent(stem + 'οι', accent, true_syllabification=False)
        gen_form = put_accent(stem + 'ου', accent, true_syllabification=False)
        if remove_diaer(plural_form) == put_accent(stem + 'οι', accent):
            plural_form = remove_diaer(plural_form)

        if remove_diaer(gen_form) == put_accent(stem + 'ου', accent):
            gen_form = remove_diaer(gen_form)

        gens_sg = []

        noun_temp['gender'] = 'masc'

        # the problem is that many long words on -os that are part of some kind of jargon and do not have any other form
        # declined in the corpus, i will assume then that words above 4 syllables do exist, but only in singular, the
        # same should be the case for neuter long words on -o
        # also some proper names in greek_corpus are, as is proper, capitalized
        if gen_form in greek_corpus or gen_form.capitalize() in greek_corpus or gender == 'masc' or number_of_syllables >4:
            gens_sg.append(gen_form)

        if accent == ANTEPENULTIMATE:
            gen_form_alt = put_accent(gen_form, PENULTIMATE, true_syllabification=False)
            if gen_form_alt in greek_corpus:
                gens_sg.append(gen_form_alt)

        noun_temp['gen_sg'] = ','.join(gens_sg)

        if plural_form in greek_corpus or plural_form.capitalize() in greek_corpus or number_of_syllables > 4 or gender == 'masc':
            noun_temp['nom_pl'] = plural_form
            if not gens_sg:
                noun_temp['gen_sg'] = gen_form

        if noun in feminine_os:
            noun_temp['gender'] = 'fem'

        if noun in feminine_or_masc or (noun[-5:] == 'λόγος' and number_of_syllables > 3):
            # especially all kinds of professionals
            noun_temp['gender'] = 'fem,masc'

        if not noun_temp['nom_pl'] and not gens_sg or gender == 'neut':
            # maybe its neuter like lathos
            plural_form = stem + 'η'
            gen_form = stem + 'ους'

            if accent == ULTIMATE:
                plural_form = stem + 'ή'
                gen_form = stem + 'ούς'
            elif accent == ANTEPENULTIMATE:
                plural_form = put_accent_on_the_penultimate(plural_form)
                gen_form = put_accent_on_the_penultimate(gen_form)

            if plural_form in greek_corpus or gen_form in greek_corpus or gender == 'neut':
                noun_temp['nom_pl'] = plural_form
                noun_temp['gen_sg'] = gen_form
                noun_temp['gender'] = 'neut'

            # γεγονός και άλλες μετοχές τού παρακειμένου
            plural_form = noun[:-1] + 'τα'
            gen_form = noun[:-1] + 'τος'
            if plural_form in greek_corpus or gen_form in greek_corpus:
                noun_temp['nom_pl'] = plural_form
                noun_temp['gen_sg'] = gen_form
                noun_temp['gender'] = 'neut'

        # in all other instances probably they are correct masculine words, but don't occur in the corpus, still for
        # proper name don't add plural if it doesn't exist in the corpus
        if not (noun_temp['nom_pl'] or noun_temp['gen_sg']):

            stem = noun[:-2]
            plural_form = stem + 'οι'
            gen_form = put_accent(stem + 'ου', accent, true_syllabification=False)
            noun_temp['gender'] = 'masc'
            if accent == ULTIMATE:
                plural_form = stem + 'οί'
                gen_form = stem + 'ού'
            if not proper_name:
                noun_temp['nom_pl'] = plural_form
            noun_temp['gen_sg'] = gen_form
            noun_temp['gender'] = 'masc'

    elif noun[-1] == 'ς' and \
            ((noun[:-1] + 'δες' in greek_corpus) or (put_accent_on_the_antepenultimate(noun[:-1] + 'δες') in
                                                     greek_corpus)) and noun[-2:] != 'ις':
        # imparisyllaba on des, archaic and modern

        noun_temp['gender'] = 'masc'
        noun_temp['gen_sg'] = noun[:-1]
        plurals = []
        plural_form = noun[:-1] + 'δες'
        # sometimes the accent has to be moved, and sometimes there are alternatives
        plural_form_a = put_accent_on_the_antepenultimate(plural_form)
        plural_form_b = put_accent_on_the_penultimate(plural_form)

        if plural_form in greek_corpus:
            plurals.append(plural_form)
        if plural_form_a in greek_corpus:
            plurals.append(plural_form_a)
        if plural_form_b in greek_corpus:
            plurals.append(plural_form_b)
        plurals = list(set(plurals))
        noun_temp['nom_pl'] = ','.join(plurals)
        gen_form = noun[:-1]
        gen_form_a = put_accent_on_the_penultimate(gen_form)
        gen_form_arch = noun[:-1] + 'δος'
        if count_syllables(noun) == 1:
            gen_form_arch = put_accent_on_the_ultimate(gen_form_arch)

        gens = []
        if gen_form in greek_corpus:
            gens.append(gen_form)
        if gen_form_a in greek_corpus:
            gens.append(gen_form_a)
        if gen_form_arch in greek_corpus:
            gens.append(gen_form_arch)
        gens = list(set(gens))
        noun_temp['gen_sg'] = ','.join(gens)

    elif noun[-2:] in ['ές', 'ες']:

        # they can be either pluralia tantum or masc on es that do not have plur in the corpus or neuter on es or aklito
        if noun[:-1] in greek_corpus or noun[:-1].capitalize() in greek_corpus:
            # this means its a gen. of a masc form
            noun_temp['gender'] = 'masc'
            noun_temp['gen_sg'] = noun[:-1]

            nom_pl = noun[:-1] + 'δες'
            if nom_pl not in greek_corpus:

                nom_pl_alt = put_accent(noun[:-2] + 'ηδες', ANTEPENULTIMATE)

                if nom_pl_alt in greek_corpus:
                    nom_pl = nom_pl_alt
            noun_temp['nom_pl'] = nom_pl

        elif put_accent(noun[:-2] + 'ους', accent) in greek_corpus:
            noun_temp['gen_sg'] = put_accent(noun[:-2] + 'ους', accent)
            noun_temp['nom_pl'] = put_accent(noun[:-2] + 'η', accent)
            noun_temp['gender'] = 'neut'

        elif (noun[:-2] + 'ων') in greek_corpus or (remove_all_diacritics(noun[:-2]) + 'ών') in greek_corpus or \
                (noun[:-2] + 'ων').capitalize() in greek_corpus or (remove_all_diacritics(noun[:-2]) + 'ών').capitalize() in greek_corpus or noun in ['προάλλες', 'πρόποδες']:

            noun_temp['gender'] = 'fem'
            if noun in ['πρόποδες', 'χοιράδες']:
                noun_temp['gender'] = 'masc'
            noun_temp['gen_sg'] = ''
            noun_temp['nom_pl'] = noun
            noun_temp['nom_sg'] = ''

        else:
            # should be neuter aklita
            noun_temp['gender'] = 'neut'
            noun_temp['gen_sg'] = noun
            noun_temp['nom_pl'] = noun
            noun_temp['nom_sg'] = noun

    elif noun[-2:] in ['άς', 'ής', 'ας', 'ης']:
        noun_temp['gender'] = 'masc'
        # es
        plural_form_a = noun[:-2] + 'ες'
        gen_form_a = noun[:-1]
        if ultimate_accent:
            plural_form_a = noun[:-2] + 'ές'
        # eas - eis,
        plural_form_b = noun[:-3] + 'είς'
        gen_form_b = noun[:-1]
        # hs, eis
        plural_form_ba = noun[:-2] + 'είς'
        gen_form_ba = noun[:-2] + 'ούς'
        # ancient forms
        plural_form_c = noun[:-1] + 'τες'
        plural_form_c_neut = noun[:-1] + 'τα'
        gen_form_c = noun[:-1] + 'τος'
        if not ultimate_accent:
            plural_form_c = put_accent_on_the_antepenultimate(plural_form_c, true_syllabification=False)
            plural_form_c_neut = put_accent_on_the_antepenultimate(plural_form_c_neut, true_syllabification=False)
            gen_form_c = put_accent_on_the_antepenultimate(gen_form_c, true_syllabification=False)

        if plural_form_c in greek_corpus and gen_form_c in greek_corpus:
            nom_pl = plural_form_c
            gen_sg = gen_form_c
            # but there is possible, that there is also more dimotiki form of gen_sg
            if gen_form_a in greek_corpus:
                gen_sg = gen_form_c + ',' + gen_form_a

        elif (plural_form_b in greek_corpus and gen_form_b in greek_corpus) and noun[-3:] not in ['ίας']:
            # the last condition is to exclude possibility, that it is false positive because of some same sounding
            # fut aorist forms
            nom_pl = plural_form_b
            gen_sg = gen_form_b

        elif plural_form_ba in greek_corpus and gen_form_ba in greek_corpus:
            nom_pl = plural_form_ba
            gen_sg = gen_form_ba

        elif plural_form_a in greek_corpus:

            nom_pl = plural_form_a

            gen_sg = gen_form_a

        elif plural_form_c_neut in greek_corpus and gen_form_c in greek_corpus:
            nom_pl = plural_form_c_neut
            gen_sg = gen_form_c
            noun_temp['gender'] = 'neut'

        else:
            nom_pl = None
            gen_sg = None

        if nom_pl:
            noun_temp['nom_pl'] = nom_pl
            noun_temp['gen_sg'] = gen_sg

        elif noun[-2:] == 'άς':
            # if corpus doesnt help, more probable is that ending in as is imparisyllaba
            noun_temp['nom_pl'] = noun[:-1] + 'δες'
            noun_temp['gen_sg'] = gen_form_a
            # there are many professions that are rarely in plural, but which do have gen, and almost all of them
            # create gen by subtracting s
        else:

            noun_temp['nom_pl'] = plural_form_a
            if noun[-3:] == 'έας':
                noun_temp['nom_pl'] = plural_form_b
            noun_temp['gen_sg'] = gen_form_a

        # lastly check maybe there are professions which can be feminine
        if noun in feminine_or_masc:
            noun_temp['gender'] = 'masc,fem'
        # and again a better test for all -eas, if there is gen sg on ews, this  has certainly femine form, this gen
        # form cannot be added as an alternative, as it occures only for feminines and has to be added in create_all
        # function
        fem_gen = noun[:-3] + 'έως'

        if noun[-3:] == 'έας' and fem_gen in greek_corpus:
            noun_temp['gender'] = 'masc,fem'

    elif noun[-3:] in ['εύς', 'ευς']:

        plural_form = noun[:-3] + 'είς'
        gen_form = noun[:-3] + 'έως'
        noun_temp['gender'] = 'masc'
        if plural_form in greek_corpus and gen_form in greek_corpus:
            noun_temp['nom_pl'] = plural_form
            noun_temp['gen_sg'] = gen_form
        if noun == 'Ζευς':

            noun_temp['gen_sg'] = 'Διός,Δίος'
            noun_temp['nom_pl'] = ''

        if noun in feminine_or_masc:
            noun_temp['gender'] = 'fem,masc'

    elif noun[-2:] in ['ώς', 'ως']:
        noun_temp['gender'] = 'neut'
        plural_form = noun[:-1] + 'τα'
        gen_form = noun[:-1] + 'τος'
        thema_ot = put_accent(noun[:-2] + 'οτ', accent)
        if count_syllables(noun) == 1:
            gen_form = put_accent_on_the_ultimate(gen_form)
            plural_form = put_accent_on_the_antepenultimate(plural_form)
        if plural_form in greek_corpus or gen_form in greek_corpus:
            noun_temp['nom_pl'] = plural_form
            noun_temp['gen_sg'] = gen_form
        # there is possibility, that the thema is on 'οτ'
        elif thema_ot + 'ος' in greek_corpus:
            noun_temp['gender'] = 'neut'
            gen_form = thema_ot + 'ος'
            plural_form = thema_ot + 'α'
            noun_temp['nom_pl'] = plural_form
            noun_temp['gen_sg'] = gen_form
        # there are also rare feminine on ως with gen on υος eg 'αιδώς'
        elif put_accent(noun[:-2] + 'ους', accent) in greek_corpus:
            gen_form = put_accent(noun[:-2] + 'ους', accent)
            noun_temp['gen_sg'] = gen_form
            noun_temp['gender'] = 'fem'
        elif noun == 'άλως':
            # its kind of exception
            gen_form = 'άλω'
            noun_temp['gen_sg'] = gen_form
            noun_temp['gender'] = 'fem'

    elif noun[-2:] in ['ις', 'ΐς', 'ίς']:
        noun_temp['gender'] = 'fem'
        plural_form = put_accent_on_the_penultimate(noun[:-2] + 'εις', true_syllabification=False)

        gen_form = noun[:-2] + 'εως'
        if noun == 'μις':
            # special case
            plural_form = noun
            gen_form = noun

        if gen_form in greek_corpus or plural_form in greek_corpus:
            noun_temp['nom_pl'] = plural_form
            noun_temp['gen_sg'] = gen_form

        else:
            # maybe gen on idos
            gen_form = noun[:-1] + 'δος'
            plural_form = noun[:-1] + 'δες'
            print(gen_form, plural_form)
            if gen_form in greek_corpus or plural_form in greek_corpus or gender == 'fem':
                noun_temp['nom_pl'] = plural_form
                noun_temp['gen_sg'] = gen_form

    elif noun[-3:] in ['ους', 'ούς']:
        if 'πλους' in noun or 'νους' in noun and noun != 'μπόνους':
            noun_temp['gender'] = 'masc'
            noun_temp['gen_sg'] = noun[:-1]
        elif noun == 'ους':
            # το αυτί χρειάζεται να είναι μόνο του
            noun_temp['gender'] = 'neut'
            noun_temp['gen_sg'] = 'ωτός'
            noun_temp['nom_pl'] = 'ώτα'
        else:
            # aklita
            noun_temp['gender'] = 'neut'
            noun_temp['gen_sg'] = noun
            noun_temp['nom_pl'] = noun

    elif noun[-2:] in ['υς', 'ύς']:
        noun_temp['gender'] = 'fem'
        gen_form = noun[:-1] + 'ος'
        thema = put_accent_on_the_ultimate(noun)
        if count_syllables(noun) == 1:
            gen_form = put_accent_on_the_ultimate(gen_form)
        plur_form = thema[:-1] + 'ες'
        if noun in ['βοτρύς','ιχθύς','πέλεκυς', 'μυς']:
            noun_temp['gender'] = 'masc'
        if noun == 'πέλεκυς':
            gen_form = 'πελέκεως'
            plur_form = 'πελέκεις'

        noun_temp['gen_sg'] = gen_form
        noun_temp['nom_pl'] = plur_form

    elif noun[-1] in ['α', 'η', 'ά', 'ή']:
        # feminina
        noun_temp['gender'] = 'fem'
        gen_a = noun + 'ς'
        noun_temp['gen_sg'] = gen_a
        plural_form_a = noun[:-1] + 'ες'
        if ultimate_accent:
            plural_form_a = noun[:-1] + 'ές'
        plural_form_b = put_accent_on_the_penultimate(noun[:-1] + 'εις', true_syllabification=False)
        plural_form_c = noun + 'δες'

        if plural_form_c in greek_corpus:
            noun_temp['nom_pl'] = plural_form_c

        elif plural_form_a in greek_corpus and plural_form_a not in ['γες']:
            # unfortunetly for some very short words it can fail, ad hoc solution is to implement some kind of a list
            noun_temp['nom_pl'] = plural_form_a

        # special case for neuter on ma
        if noun[-2:] == 'μα' and (plural_form_a not in greek_corpus or
                                  plural_form_b not in greek_corpus or
                                  plural_form_c not in greek_corpus or
                                gender == 'neut' or
                                  put_accent_on_the_antepenultimate(noun + 'τα', true_syllabification=False) in greek_corpus):
            plural_form = put_accent_on_the_antepenultimate(noun + 'τα', true_syllabification=False)
            gen_form = put_accent_on_the_antepenultimate(noun + 'τος', true_syllabification=False)
            noun_temp['nom_pl'] = plural_form
            noun_temp['gen_sg'] = gen_form
            noun_temp['gender'] = 'neut'
        elif noun[-1] == 'α' and noun + 'τος' in greek_corpus and noun + 'τα' in greek_corpus or gender == 'neut':
            # gala, galatos

            noun_temp['nom_sg'] = noun
            noun_temp['nom_pl'] = put_accent_on_the_antepenultimate(noun + 'τα')
            noun_temp['gen_sg'] = put_accent_on_the_antepenultimate(noun + 'τος')
            noun_temp['gender'] = 'neut'
            if 'γάλα' in noun:
                noun_temp['nom_pl'] = noun + 'τα' + ',' + noun + 'κτα'
                noun_temp['gen_sg'] = noun + 'τος' + ',' + noun + 'κτος'
        if (noun[-1] in ['α', 'ά'] and gen_a not in greek_corpus and plural_form_a not in greek_corpus
              and put_accent(noun[:-1] + 'ων', accent) in greek_corpus) or noun in plur_tant_neut:

            # maybe pluralia tantum
            noun_temp['nom_sg'] = ''
            noun_temp['nom_pl'] = noun
            noun_temp['gen_sg'] = ''
            noun_temp['gender'] = 'neut'

        if (noun[-2:] in ['ση', 'ξη', 'ψη'] or noun in feminine_h_eis) and put_accent_on_the_ultimate(noun[:-1] + 'ων') not in greek_corpus:
            # it has to be if, because it can be earlier falsly recognized as a correct form on es, because of som aorists
            # in sec person sg
            noun_temp['nom_pl'] = plural_form_b
            noun_temp['gen_sg'] = gen_a + ',' + put_accent_on_the_antepenultimate(noun[:-1] + 'εως', true_syllabification=False)

    elif noun[-2:] == 'ού':
        noun_temp['gender'] = 'fem'
        noun_temp['gen_sg'] = noun + 'ς'
        plural_form = noun + 'δες'
        if plural_form in greek_corpus:
            noun_temp['nom_pl'] = plural_form

    elif noun[-1] in ['ό', 'ο']:
        if noun[-3:] == 'ιμο':
            plural_form = noun[:-1] + 'ατα'
            gen_form = noun[:-1] + 'ατος'
            plural_form = put_accent_on_the_antepenultimate(plural_form)
            gen_form = put_accent_on_the_penultimate(gen_form)
            if plural_form in greek_corpus or gen_form in greek_corpus:
                noun_temp['nom_pl'] = plural_form
                noun_temp['gen_sg'] = gen_form
                noun_temp['gender'] = 'neut'

                return noun_temp

        noun_temp['gender'] = 'neut'
        plural_form = noun[:-1] + 'α'
        gen_form = noun[:-1] + 'ου'
        if ultimate_accent:
            plural_form = noun[:-1] + 'ά'
            gen_form = noun[:-1] + 'ού'
        if plural_form in greek_corpus or\
                plural_form.capitalize() in greek_corpus or\
                number_of_syllables>4 or\
                (gender not in ['fem', 'masc'] and inflection != 'aklito'):

            noun_temp['nom_pl'] = plural_form

        gens = []
        if gen_form in greek_corpus or\
                gen_form.capitalize() in greek_corpus or\
                number_of_syllables>4 :
            gens.append(gen_form)

        if accent == ANTEPENULTIMATE:
            gen_a = put_accent(gen_form, PENULTIMATE, true_syllabification=False)
            if gen_a in greek_corpus:
                gens.append(gen_a)

        if gens:
            noun_temp['gen_sg'] = ','.join(gens)
        elif gender not in ['fem', 'masc'] and inflection != 'aklito':
            noun_temp['gen_sg'] = gen_form
        else:
            # σ`αυτήν την περίπτωση υποθετούμε πως είναι ουδέτερα άκλιτα
            noun_temp['nom_pl'] = noun
            noun_temp['gen_sg'] = noun
            noun_temp['gender'] = 'neut'

    elif noun[-1] in ['ι', 'ί', 'ΐ'] and noun[-2:] not in ['οι', 'οί']:
        noun_temp['gender'] = 'neut'
        plural_form = noun + 'α'
        gen_form = put_accent_on_the_ultimate(noun + 'ου')
        if ultimate_accent:
            plural_form = put_accent_on_the_ultimate(plural_form)

        if plural_form[-3] in vowels:

            plural_form = plural_form[:-2] + 'γι' + plural_form[-1]
            gen_form = gen_form[:-3] + 'γι' + gen_form[-2:]

        # in greek corpus there are lacking some upokoristika
        if plural_form in greek_corpus or noun[-3:] in ['άκι', 'ίκι', 'άρι', 'έκι', 'ήρι', 'ίδι', 'ύρι']:
            noun_temp['nom_pl'] = plural_form

            noun_temp['gen_sg'] = gen_form

        elif inflection != "aklito":
            # if corpus doesnt help, but we know, that it's declinab
            noun_temp['nom_pl'] = plural_form
        if noun_temp['nom_pl'] == '' and noun_temp['gen_sg'] == '':
            # we conclude these are aklita, but I am sure there will be some uncovered words that do decline,
            # I have no idea though how to sort them out
            noun_temp['nom_pl'] = noun
            noun_temp['gen_sg'] = noun

    elif noun[-2:] in ['οι', 'οί']:
        # pluralis tantum masc
        noun_temp['gender'] = 'masc'
        noun_temp['nom_pl'] = noun
        noun_temp['nom_sg'] = ''
        noun_temp['gen_sg'] = ''

    # ending n is a bit tricky, so we will work it out separatly

    elif noun[-2:] in ['ον', 'όν', 'έν', 'εν', 'άν', 'αν']:
        # ουδετερα ουσιαστικά με θέμα σε -ντ, παιρνει ύποψη και τα αρχαία ουδέτερα Β' κλίσης σε -ον

        noun_temp['gender'] = 'neut'
        plural_form = noun + 'τα'

        gen_form = noun + 'τος'
        # αρχαίες λέξεις με ον
        plural_form_a = ''
        gen_form_a = ''

        if noun[-2:] in ['ον', 'όν']:
            plural_form_a = noun[:-2] + 'ά'
            gen_form_a = noun[:-2] + 'ού'

            if not ultimate_accent:
                plural_form_a = noun[:-2] + 'α'
                gen_form_a = put_accent_on_the_penultimate(gen_form_a,
                                                       true_syllabification=False)
        if not is_accented(noun):
            # μονοσύλλαβα τονίζονται στην γενική στην ληγούσα
            plural_form = put_accent_on_the_penultimate(plural_form, true_syllabification=False)
            gen_form = put_accent_on_the_ultimate(gen_form)
            if noun == 'ον': gen_form = put_accent_on_the_penultimate(gen_form)

        if plural_form in greek_corpus and gen_form in greek_corpus:

            noun_temp['nom_pl'] = plural_form
            noun_temp['gen_sg'] = gen_form

        elif plural_form_a in greek_corpus and gen_form_a in greek_corpus:
            noun_temp['nom_pl'] = plural_form_a
            noun_temp['gen_sg'] = gen_form_a
        else:
            # it is assumed it's a borrowing from french

            if noun in ['ρεσεψιόν', 'σπορτσγούμαν']:
                # there are certainly more
                noun_temp['gender'] = 'fem'
            noun_temp['nom_pl'] = noun
            noun_temp['gen_sg'] = noun

    elif noun[-2:] in ['ων', 'ών']:
        noun_temp['gender']= 'masc'

        irregular_3 = {'κύων': 'κυν', 'είρων': 'είρων', 'ινδικτιών': 'ινδικτιών'}

        # 2 possibilities
        stem_a = noun[:-2] + 'όν'
        stem_b = noun[:-2] + 'όντ'
        stem_c = noun[:-2] + 'ούντ'
        stem_d = noun[:-2] + 'ώντ'

        plural_form_a = stem_a + 'ες'
        gen_form_a = stem_a + 'ος'
        plural_form_b = stem_b + 'ες'
        gen_form_b = stem_b + 'ος'
        plural_form_c = stem_c + 'ες'
        gen_form_c = stem_c + 'ος'
        plural_form_d = stem_d + 'ες'
        gen_form_d = stem_d + 'ος'

        ir_stem = False
        if noun in irregular_3.keys():
            ir_stem = irregular_3[noun]

        if ir_stem:

            ir_pl = ir_stem + 'ες'
            ir_gen = ir_stem + 'ος'
            if count_syllables(ir_stem) == 1 and ir_gen not in greek_corpus:
                ir_pl = put_accent_on_the_antepenultimate(ir_pl)
                ir_gen = put_accent_on_the_antepenultimate(ir_gen)
                if ir_gen not in greek_corpus:
                    ir_gen = put_accent_on_the_ultimate(ir_gen)

            if ir_pl in greek_corpus and ir_gen in greek_corpus:
                noun_temp['nom_pl'] = ir_pl
                noun_temp['gen_sg'] = ir_gen

                return noun_temp

        if not ultimate_accent:
            plural_form_a = put_accent_on_the_antepenultimate(plural_form_a, true_syllabification=False)
            gen_form_a = put_accent_on_the_antepenultimate(gen_form_a, true_syllabification=False)
            plural_form_b = put_accent_on_the_antepenultimate(plural_form_b, true_syllabification=False)
            gen_form_b = put_accent_on_the_antepenultimate(gen_form_b, true_syllabification=False)

        if plural_form_a in greek_corpus and gen_form_a in greek_corpus:
            noun_temp['nom_pl'] = plural_form_a
            noun_temp['gen_sg'] = gen_form_a
        elif plural_form_b in greek_corpus and gen_form_b in greek_corpus:
            noun_temp['nom_pl'] = plural_form_b
            noun_temp['gen_sg'] = gen_form_b
        elif plural_form_c in greek_corpus and gen_form_c in greek_corpus:
            noun_temp['nom_pl'] = plural_form_c
            noun_temp['gen_sg'] = gen_form_c
        elif plural_form_d in greek_corpus and gen_form_d in greek_corpus:
            noun_temp['nom_pl'] = plural_form_d
            noun_temp['gen_sg'] = gen_form_d

    elif noun[-1] in ['ξ', 'ψ', 'τ', 'ρ',  'β', 'ν', 'δ', 'ε', 'έ', 'ζ', 'κ', 'λ', 'μ'] and \
            noun not in ['σεξ', 'σερ', 'φαξ', 'μπορ', 'μπαρ', 'μποξ'] and inflection != 'aklito':
        # not very common but existing 3rd declension nouns

        stems = []

        if noun[-1] == 'ξ':

            stems.append(noun[:-1] + 'κ')
            stems.append(noun[:-1] + 'χ')
            stems.append(noun[:-1] + 'κτ')
        elif noun[-1] == 'ψ':

            stems.append(noun[:-1] + 'π')
            stems.append(noun[:-1] + 'φ')
            stems.append(noun[:-1] + 'πτ')
            stems.append(noun[:-1] + 'β')

        elif noun[-1] == 'ρ':

            stems.append(noun)
            stems.append(noun[:-1] + 'τ')
            if noun[-2:] == 'ωρ':
                stems.append(noun[:-2] + 'ορ')
                noun_temp['gender'] = 'masc'

                if 'μήτωρ' in noun:
                    noun_temp['gender'] = 'fem'
            elif noun[-2:] == 'ώρ':
                stems.append(noun[:-2] + 'όρ')
                noun_temp['gender'] = 'masc'
            else:
                noun_temp['gender'] = 'neut'

        for stem in stems:
            plural_form = stem + 'ες'
            modern_form = stem + 'ας'
            plural_form_n = stem + 'α'
            gen_form = stem + 'ος'
            if count_syllables(stem) == 1:
                plural_form = put_accent_on_the_antepenultimate(plural_form)
                plural_form_n = put_accent_on_the_antepenultimate(plural_form_n)
                gen_form = put_accent_on_the_antepenultimate(gen_form)
                if gen_form not in greek_corpus:
                    gen_form = put_accent_on_the_ultimate(gen_form)
            elif where_is_accent(stem) == ANTEPENULTIMATE:
                gen_form = put_accent_on_the_antepenultimate(gen_form)
                plural_form = put_accent_on_the_antepenultimate(plural_form)
                plural_form_n = put_accent_on_the_antepenultimate(plural_form_n)

            if (plural_form in greek_corpus or modern_form in greek_corpus) and noun not in ['πυρ']:
                noun_temp['nom_pl'] = plural_form
                if gen_form in greek_corpus or modern_form in greek_corpus:
                    noun_temp['gen_sg'] = gen_form
                if gender:
                    noun_temp['gender'] = gender
                # it's a bit crude way to correct gender but i cannot find a better one without a comprehensive list
                # gen_pl = remove_all_diacritics(plural_form[:-2]) + 'ών'
                # if gen_pl in greek_corpus:
                #     noun_temp['gender'] = 'fem'
                return noun_temp
            else:
                if plural_form_n in greek_corpus or noun in ['έαρ']:
                    noun_temp['gender'] = 'neut'
                    noun_temp['gen_sg'] = gen_form
                    if noun not in ['έαρ']:
                        noun_temp['nom_pl'] = plural_form_n
                    return noun_temp

        # else it is assumed it's either borrowing or some substantiated other things

        noun_temp['gender'] = 'neut'
        noun_temp['nom_pl'] = noun
        noun_temp['gen_sg'] = noun
        if noun in ['σπεσιαλιτέ', 'ρεσεψιόν']:
            # there are probably more such cases
            noun_temp['gender'] = 'fem'
        if noun in ['σερ']:
            # there should be added probably a lot of proper names, but I will deal with it by using
            # a flag proper_name_gender
            noun_temp['gender'] = 'masc'

    elif noun[-1] in ['ώ', 'ω']:

        if noun in ['ηχώ', 'πειθώ', 'φειδώ', 'βάβω']:
            # ancient feminina
            noun_temp['gender'] = 'fem'

            noun_temp['gen_sg'] = noun[:-1] + 'ούς'
            if noun in ['βάβω']:
                noun_temp['gen_sg'] = noun
        elif capital or proper_name:
            # feminine proper name
            noun_temp['gender'] = 'fem'
            noun_temp['gen_sg'] = noun + 'ς'

        else:
            noun_temp['gender'] = 'neut'
            noun_temp['nom_pl'] = noun
            noun_temp['gen_sg'] = noun

    elif noun[-1] in ['υ', 'ύ']:
        # ancient 3 declension, oksy , asty
        noun_temp['gender'] = 'neut'
        if noun[-2:] in ['ου', 'ού']:
            noun_temp['nom_pl'] = noun
            noun_temp['gen_sg'] = noun
        elif noun[-1] == 'υ':
            gen_1 = noun + 'ου'
            gen_1b = put_accent_on_the_penultimate(gen_1)
            plural = noun + 'α'

            if gen_1 in greek_corpus:
                noun_temp['gen_sg'] = gen_1
            elif gen_1b in greek_corpus:
                noun_temp['gen_sg'] = gen_1b
            if plural in greek_corpus:
                noun_temp['nom_pl'] = plural

            if noun in ['άστυ', 'δόρυ']:
                noun_temp['nom_pl'] = noun[:-1] + 'η'
                noun_temp['gen_sg'] = noun[:-1] + 'εως'
            if noun in ['βράδυ']:
                noun_temp['nom_pl'] = noun[:-1] + 'ια'
                noun_temp['gen_sg'] = put_accent_on_the_ultimate(noun[:-1] + 'ιου')
            if noun in ['στάχυ', 'δίχτυ']:
                noun_temp['nom_pl'] = noun + 'α'
                noun_temp['gen_sg'] = put_accent_on_the_ultimate(noun + 'ου')
            if noun in ['δάκρυ']:
                noun_temp['nom_pl'] = noun + 'α'
                noun_temp['gen_sg'] = put_accent_on_the_penultimate(noun + 'ου', true_syllabification=False)
        elif noun[-1] in ['ύ']:
            thema = noun[:-1] + 'έ'
            gen = thema + 'ος'
            plur = thema + 'α'
            if gen in greek_corpus:
                noun_temp['gen_sg'] = gen
            if plur in greek_corpus:
                noun_temp['nom_pl'] = plur

    if not noun_temp['nom_pl'] and not noun_temp['gen_sg']:

        # aklita

        noun_temp['gender'] = 'neut'
        noun_temp['nom_pl'] = noun
        noun_temp['gen_sg'] = noun

        if noun.lower() in aklita_gender.keys():
            noun_temp['gender'] = aklita_gender[noun.lower()]

    if gender:
        noun_temp['gender'] = gender

        if gender == 'fem_pl':
            noun_temp['gender'] = 'fem'
            noun_temp['nom_sg'] = ''
            noun_temp['nom_pl'] = noun
            noun_temp['gen_sg'] = ''
        elif gender == 'masc_pl':
            noun_temp['gender'] = 'masc'
            noun_temp['nom_sg'] = ''
            noun_temp['nom_pl'] = noun
            noun_temp['gen_sg'] = ''

        elif gender == 'neut_pl':
            noun_temp['gender'] = 'neut'
            noun_temp['nom_sg'] = ''
            noun_temp['nom_pl'] = noun
            noun_temp['gen_sg'] = ''
        elif gender == 'fem_sg':
            noun_temp['gender'] = 'fem'
            noun_temp['nom_sg'] = noun
            noun_temp['nom_pl'] = ''
        elif gender == 'masc_sg':
            noun_temp['gender'] = 'masc'
            noun_temp['nom_pl'] = ''
        elif gender == 'neut_sg':
            noun_temp['gender'] = 'neut'
            noun_temp['nom_pl'] = ''

    if noun in irregular_nouns.keys():
        noun_temp = irregular_nouns[noun]

    if noun in diploklita.keys():
        noun_temp['nom_pl'] = diploklita[noun]
    if inflection == 'aklito':
        noun_temp['nom_sg'] = noun
        if not proper_name:
            noun_temp['nom_pl'] = noun
        else:
            noun_temp['nom_pl'] = ''
        noun_temp['gen_sg'] = noun

    # check one more time these, that do not have flag aklito, but are surmised to be, maybe removing a prefix we will
    # be able to find out the correct declesion type
    if inflection != "aklito" and noun_temp['nom_pl'] == noun_temp['nom_sg']:
        for prefix in prefixes:
            pr_l = len(prefix)
            if prefix in noun and prefix == noun[:pr_l]:
                res = create_all_basic_noun_forms(noun[pr_l:])
                new_res = {}
                for key in res.keys():
                    if key != 'gender':
                        new_res[key] = prefix + res[key]
                new_res['gender'] = res['gender']
                noun_temp = new_res
                break

    if capital:
        noun_temp = capitalize_basic_forms(noun_temp)

    return noun_temp
def create_all_pers_forms(conjugation_name,
                          root,
                          active_root=None,
                          deaugmented_root=None,
                          simple_aor=False):
    """
    :param conjugation_name: conjugation name
    :param root: verb root
    :param active_root: if deponens, then should be given if it's a special case
    :param deaugmented_root: root without augment
    :param simple_aor: sygmatic aorist
    :return:
    """
    forms = {}

    if not conjugation_name or conjugation_name in [
            'modal', 'con1_pass_modal'
    ]:
        return 'modal'
    endings = conjugations[conjugation_name]

    for number in endings.keys():
        forms[number] = {}
        for person in endings[number].keys():
            forms[number][person] = []
            for ending in endings[number][person]:
                form = root + ending
                if count_syllables(
                        ending) == 2 and ending == remove_all_diacritics(
                            ending):
                    form = put_accent_on_the_antepenultimate(form)
                forms[number][person].append(form)

    # check if a verb in 2nd conjugation active has alternative endings belonging to other type of the 2nd con

    if conjugation_name in ['con2a_act', 'imper_act_cont_2a']:
        if root + 'είς' in greek_corpus and root + 'εί' in greek_corpus:
            endings = conjugations['con2b_act']
            if conjugation_name == 'imper_act_cont_2a':
                endings = conjugations['imper_act_cont_2b']
            for number in endings:
                for person in endings[number]:
                    for alt_ending in endings[number][person]:
                        forms[number][person].append(root + alt_ending)

    if conjugation_name in ['con2b_act', 'imper_act_cont_2b']:
        if root + 'άς' in greek_corpus and root + 'άει' in greek_corpus:
            endings = conjugations['con2a_act']
            if conjugation_name == 'imper_act_cont_2b':
                endings = conjugations['imper_act_cont_2a']
            for number in endings:
                for person in endings[number]:
                    for alt_ending in endings[number][person]:
                        forms[number][person].append(root + alt_ending)

    if simple_aor:
        for number in endings.keys():
            forms[number] = {}
            for person in endings[number].keys():
                forms[number][person] = []
                for ending in endings[number][person]:

                    if deaugmented_root and count_syllables(ending) > 1:
                        form = put_accent_on_the_antepenultimate(
                            deaugmented_root + ending)
                        forms[number][person].append(form)
                    else:
                        form = put_accent_on_the_antepenultimate(root + ending)

                        forms[number][person].append(form)

                    if conjugation_name == 'arch_pass_aor' and number == 'sg':
                        forms[number][person][
                            0] = put_accent_on_the_penultimate(
                                forms[number][person][0])

                    if form != put_accent_on_the_antepenultimate(
                            form, true_syllabification=False):
                        if deaugmented_root:
                            form = deaugmented_root + ending
                        forms[number][person].append(
                            put_accent_on_the_antepenultimate(
                                form, true_syllabification=False))

    if conjugation_name in ['con1_pass']:
        forms['pl']['pri'][0] = put_accent_on_the_antepenultimate(
            forms['pl']['pri'][0])
        forms['pl']['sec'][1] = put_accent_on_the_antepenultimate(
            forms['pl']['sec'][1])

    elif conjugation_name in ['parat1_pass']:
        forms['pl']['ter'][0] = put_accent_on_the_antepenultimate(
            forms['pl']['ter'][0])

    elif conjugation_name in ['parat2d_pass', 'parat2b_logia', 'parat2b_pass']:
        # add augment to archaic forms
        forms_ind_with_augmented_forms = forms.copy()
        for number in forms.keys():
            for person in forms[number]:
                for form in (forms[number][person]):
                    augmented_forms = add_augment(form)
                    for augmented_form in augmented_forms:

                        if remove_all_diacritics(
                                augmented_form) == augmented_form:
                            augmented_form = put_accent_on_the_antepenultimate(
                                augmented_form)
                        if augmented_form in greek_corpus:

                            if augmented_form not in forms[number][person]:
                                forms_ind_with_augmented_forms[number][
                                    person].append(augmented_form)

        forms = forms_ind_with_augmented_forms

    elif conjugation_name in ['con2d_pass']:
        for number in forms.keys():
            for person in forms[number]:
                for index, form in enumerate(forms[number][person]):
                    forms[number][person][
                        index] = put_accent_on_the_antepenultimate(form)

    elif conjugation_name in ['con2b_act', 'con2c_act', 'imper_act_aor_c']:
        for number in forms.keys():
            for person in forms[number]:
                for index, form in enumerate(forms[number][person]):
                    if count_syllables(form) == 1:
                        forms[number][person][index] = remove_all_diacritics(
                            form)

    elif conjugation_name in [
            'imper_act_cont_1', 'imper_act_cont_2c', 'imper_act_aor_a',
            'imper_act_aor_b'
    ]:
        forms['sg']['sec'][0] = put_accent_on_the_antepenultimate(
            forms['sg']['sec'][0])

    elif conjugation_name in ['imper_pass_aor_a']:
        if active_root and active_root[-1] in ['σ', 'ψ', 'ξ']:
            forms['sg']['sec'][0] = active_root + 'ου'
        else:
            passive_aorist_recreated = create_imp_pass(root)
            forms['sg']['sec'][0] = passive_aorist_recreated

    elif conjugation_name in ['imper_act_cont_2a']:
        forms['sg']['sec'][0] = put_accent_on_the_penultimate(
            forms['sg']['sec'][0])
        forms['sg']['sec'][1] = put_accent_on_the_antepenultimate(
            forms['sg']['sec'][1])
        if len(forms['sg']['sec']) == 3:
            forms['sg']['sec'][2] = put_accent_on_the_penultimate(
                forms['sg']['sec'][2])
        # accent
        if forms['sg']['sec'][0] != put_accent_on_the_penultimate(
                forms['sg']['sec'][0], true_syllabification=False):
            forms['sg']['sec'].append(
                put_accent_on_the_penultimate(forms['sg']['sec'][0],
                                              true_syllabification=False))

    elif conjugation_name in ['con2e_pass']:
        forms['pl']['pri'][0] = put_accent_on_the_antepenultimate(
            forms['pl']['pri'][0])
        forms['pl']['pri'][1] = put_accent_on_the_antepenultimate(
            forms['pl']['pri'][1])
        forms['pl']['sec'][1] = put_accent_on_the_penultimate(
            forms['pl']['sec'][1])
    elif conjugation_name in ['imper_act_aor_ca', 'imper_act_cont_2b']:
        if root == 'ζ':
            forms['sg']['ter'] = ['ζήτω']
        forms['sg']['sec'][0] = put_accent_on_the_penultimate(
            forms['sg']['sec'][0])
        if len(forms['sg']['sec']) == 3:
            forms['sg']['sec'][1] = put_accent_on_the_penultimate(
                forms['sg']['sec'][1])
            forms['sg']['sec'][2] = put_accent_on_the_antepenultimate(
                forms['sg']['sec'][2])

    #### irregular imperatives
    if conjugation_name[:5] == 'imper':

        if root in irregular_imperative_forms:
            for number in irregular_imperative_forms[root]:
                for person in irregular_imperative_forms[root][number]:
                    irregular_form = irregular_imperative_forms[root][number][
                        person]
                    try:
                        forms[number][person].append(irregular_form)
                        # in this case check validity of all imperative forms
                        forms[number][person] = [
                            form for form in forms[number][person]
                            if form in greek_corpus
                        ]
                    except:
                        print(sys.exc_info()[0])
    return forms
示例#11
0
def create_all_adj_forms(adj):
    """
    :param adj: expects masc, fem and neut forms divided with / ('ωραίος/ωραία/ωραίο). If feminine doesn't exist, it
     should be replaced with dash '-'
    :return: two element array, first is a dictionary with all primary forms (forms[number][gender][case], the second
    one is a dictionary with alternative forms, if exists it has the same structure
    """
    forms = copy.deepcopy(adj_basic_template)
    # ωμός / ωμή / ωμό
    masc, fem, neut = adj.split('/')
    # print(masc[-2:], masc[-2:] == 'ις', masc == fem, neut == '-')

    if masc[-2:] in ['ός', 'ος'] and fem[-1] in ['α', 'ά', 'η', 'ή', '-'
                                                 ] and neut[-1] in ['ο', 'ό']:
        fem = fem.split(
            ','
        )[0]  # because in the list there are given alternatives, which i don't need
        if fem == '-':
            # in my lists it sometimes happens, so this will be a solution
            fem = masc[:-2] + 'η'
            if fem[-2] in ['ι', 'ί']:
                fem = masc[:-2] + 'α'
        # os, h/a, o
        forms['sg']['masc']['nom'] = masc
        forms['sg']['masc']['acc'] = masc[:-1]
        forms['sg']['masc']['gen'] = masc[:-2] + 'ου'
        forms['sg']['masc']['voc'] = masc[:-2] + 'ε'

        forms['pl']['masc']['nom'] = masc[:-2] + 'οι'
        forms['pl']['masc']['acc'] = masc[:-2] + 'ους'
        forms['pl']['masc']['gen'] = masc[:-2] + 'ων'
        forms['pl']['masc']['voc'] = masc[:-2] + 'οι'

        if fem != '-':
            forms['sg']['fem']['nom'] = fem
            forms['sg']['fem']['acc'] = fem
            forms['sg']['fem']['gen'] = fem + 'ς'
            forms['sg']['fem']['voc'] = fem

            forms['pl']['fem']['nom'] = fem[:-1] + 'ες'
            forms['pl']['fem']['acc'] = fem[:-1] + 'ες'
            forms['pl']['fem']['gen'] = fem[:-1] + 'ων'
            forms['pl']['fem']['voc'] = fem[:-1] + 'ες'

        forms['sg']['neut']['nom'] = neut
        forms['sg']['neut']['gen'] = neut[:-1] + 'ου'
        forms['sg']['neut']['acc'] = neut
        forms['sg']['neut']['voc'] = neut

        forms['pl']['neut']['nom'] = neut[:-1] + 'α'
        forms['pl']['neut']['acc'] = neut[:-1] + 'α'
        forms['pl']['neut']['gen'] = neut[:-1] + 'ων'
        forms['pl']['neut']['voc'] = neut[:-1] + 'α'

        accent = where_is_accent(masc)
        if accent == 'ultimate':
            for num in forms.keys():
                for gender in forms[num].keys():
                    for case, form in forms[num][gender].items():
                        forms[num][gender][case] = put_accent_on_the_ultimate(
                            form)

        alt_forms = alternative_forms_kxth(fem)

        return forms, alt_forms

    elif masc[-3:] == 'ους' and neut[-3:] == 'ουν':

        forms['sg']['masc']['nom'] = masc
        forms['sg']['masc']['acc'] = masc[:-1]
        forms['sg']['masc']['gen'] = masc[:-1] + 'ν'
        forms['sg']['masc']['voc'] = masc
        forms['sg']['fem']['nom'] = masc
        forms['sg']['fem']['acc'] = masc[:-1]
        forms['sg']['fem']['gen'] = masc[:-1] + 'ν'
        forms['sg']['fem']['voc'] = masc
        forms['sg']['neut']['nom'] = neut
        forms['sg']['neut']['gen'] = neut[:-1]
        forms['sg']['neut']['acc'] = neut
        forms['sg']['neut']['voc'] = neut
        forms['pl']['masc']['nom'] = masc[:-3] + 'οι'
        forms['pl']['masc']['acc'] = masc
        forms['pl']['masc']['gen'] = masc[:-3] + 'ων'
        forms['pl']['masc']['voc'] = masc[:-3] + 'οι'
        forms['pl']['fem']['nom'] = masc[:-3] + 'οι'
        forms['pl']['fem']['acc'] = masc
        forms['pl']['fem']['gen'] = masc[:-3] + 'ων'
        forms['pl']['fem']['voc'] = masc[:-3] + 'οι'
        forms['pl']['neut']['nom'] = masc[:-3] + 'οα'
        forms['pl']['neut']['acc'] = masc[:-3] + 'οα'
        forms['pl']['neut']['gen'] = masc[:-3] + 'ων'
        forms['pl']['neut']['voc'] = masc[:-3] + 'οα'

        return forms, None

    elif (masc[-2:] in ['ύς', 'υς']
          and where_is_accent(fem) == 'ultimate') or masc == 'μέγας':
        # add alternativeσ, bathys

        forms['sg']['masc']['nom'] = masc
        forms['sg']['masc']['acc'] = masc[:-1]

        forms['sg']['masc']['voc'] = masc[:-1]

        forms['sg']['masc']['gen'] = fem[:-1] + 'ου'
        forms['sg']['fem']['nom'] = fem
        forms['sg']['fem']['acc'] = fem
        forms['sg']['fem']['gen'] = fem + 'ς'
        forms['sg']['fem']['voc'] = fem
        forms['sg']['neut']['gen'] = fem[:-1] + 'ου'
        forms['pl']['masc']['nom'] = fem[:-1] + 'οι'
        forms['pl']['masc']['acc'] = fem[:-1] + 'ους'
        forms['pl']['masc']['gen'] = fem[:-1] + 'ων'
        forms['pl']['masc']['voc'] = fem[:-1] + 'οι'
        forms['pl']['fem']['nom'] = fem[:-1] + 'ες'
        forms['pl']['fem']['acc'] = fem[:-1] + 'ες'
        forms['pl']['fem']['gen'] = fem[:-1] + 'ων'
        forms['pl']['fem']['voc'] = fem[:-1] + 'ες'
        forms['pl']['neut']['nom'] = fem[:-1] + 'α'
        forms['pl']['neut']['acc'] = fem[:-1] + 'α'
        forms['pl']['neut']['gen'] = fem[:-1] + 'ων'
        forms['pl']['neut']['voc'] = fem[:-1] + 'α'

        forms['sg']['neut']['nom'] = neut
        forms['sg']['neut']['acc'] = neut
        forms['sg']['neut']['voc'] = neut

        if masc != 'μέγας':
            for num in forms.keys():
                for gender in forms[num].keys():
                    for case, form in forms[num][gender].items():
                        forms[num][gender][case] = put_accent_on_the_ultimate(
                            form)

        alt_forms = alternative_forms_us(adj)

        return forms, alt_forms

    elif masc[-2:] in ['ύς', 'υς'] and where_is_accent(fem) == 'penultimate':
        # oksys, okseos

        forms['sg']['masc']['nom'] = masc
        forms['sg']['masc']['acc'] = masc[:-1]
        forms['sg']['masc']['gen'] = masc[:-1]
        forms['sg']['masc']['voc'] = masc[:-1]

        forms['pl']['masc']['nom'] = masc[:-2] + 'είς'
        forms['pl']['masc']['acc'] = masc[:-2] + 'είς'
        forms['pl']['masc']['gen'] = masc[:-2] + 'έων'
        forms['pl']['masc']['voc'] = masc[:-2] + 'είς'
        if fem != '-':
            forms['sg']['fem']['nom'] = fem
            forms['sg']['fem']['acc'] = fem
            forms['sg']['fem']['gen'] = fem + 'ς'
            forms['sg']['fem']['voc'] = fem
            forms['pl']['fem']['nom'] = fem[:-1] + 'ες'
            forms['pl']['fem']['acc'] = fem[:-1] + 'ες'
            forms['pl']['fem']['gen'] = fem[:-2] + 'ιών'
            forms['pl']['fem']['voc'] = fem[:-1] + 'ες'

        forms['sg']['neut']['nom'] = neut
        forms['sg']['neut']['gen'] = neut
        forms['sg']['neut']['acc'] = neut
        forms['sg']['neut']['voc'] = neut

        forms['pl']['neut']['nom'] = masc[:-2] + 'έα'
        forms['pl']['neut']['acc'] = masc[:-2] + 'έα'
        forms['pl']['neut']['gen'] = masc[:-2] + 'έων'
        forms['pl']['neut']['voc'] = masc[:-2] + 'έα'

        alt_forms = alternative_forms_us2(adj)

        return forms, alt_forms

    elif masc[-2:] in ['ης', 'άς', 'ής'
                       ] and fem[-1] in ['α', 'ύ'] and neut[-3:] == 'ικο':
        # hs, a, iko
        forms['sg']['masc']['nom'] = masc
        forms['sg']['masc']['acc'] = masc[:-1]
        forms['sg']['masc']['gen'] = masc[:-1]
        forms['sg']['masc']['voc'] = masc[:-1]
        forms['sg']['fem']['nom'] = fem
        forms['sg']['fem']['acc'] = fem
        forms['sg']['fem']['gen'] = fem + 'ς'
        forms['sg']['fem']['voc'] = fem
        forms['sg']['neut']['nom'] = neut
        forms['sg']['neut']['gen'] = neut[:-1] + 'ου'
        forms['sg']['neut']['acc'] = neut
        forms['sg']['neut']['voc'] = neut

        forms['pl']['masc']['nom'] = masc[:-1] + 'δες'
        forms['pl']['masc']['acc'] = masc[:-1] + 'δες'
        forms['pl']['masc']['gen'] = masc[:-1] + 'δων'
        forms['pl']['masc']['voc'] = masc[:-1] + 'δες'
        if fem[-2:] == 'ού':
            forms['pl']['fem']['nom'] = fem + 'δες'
            forms['pl']['fem']['acc'] = fem + 'δες'
            forms['pl']['fem']['gen'] = fem + 'δων'
            forms['pl']['fem']['voc'] = fem + 'δες'
        else:
            forms['pl']['fem']['nom'] = fem[:-1] + 'ες'
            forms['pl']['fem']['acc'] = fem[:-1] + 'ες'
            forms['pl']['fem']['gen'] = fem[:-2] + 'ων'
            forms['pl']['fem']['voc'] = fem[:-1] + 'ες'
        forms['pl']['neut']['nom'] = neut[:-1] + 'α'
        forms['pl']['neut']['acc'] = neut[:-1] + 'α'
        forms['pl']['neut']['gen'] = neut[:-1] + 'ων'
        forms['pl']['neut']['voc'] = neut[:-1] + 'α'

        alternative_forms = None
        # προσθεσε εναλλακτικές μορφές για το θυληκό γενος ξανθομάλλα και ξανθομαλλού
        if fem[-1] == 'α':
            alt_fem = put_accent_on_the_ultimate(fem[:-1] + 'ου')
            if alt_fem in greek_corpus:
                alternative_forms = alternative_forms_ou(alt_fem)

        return forms, alternative_forms

    elif masc[-2:] == 'ής' and fem[-1] == 'ά' and neut[-1] == 'ί':
        # colors hs, a, i
        forms['sg']['masc']['nom'] = masc
        forms['sg']['masc']['acc'] = masc[:-1]
        forms['sg']['masc']['gen'] = masc[:-1]
        forms['sg']['masc']['voc'] = masc[:-1]
        forms['sg']['fem']['nom'] = fem
        forms['sg']['fem']['acc'] = fem
        forms['sg']['fem']['gen'] = fem + 'ς'
        forms['sg']['fem']['voc'] = fem
        forms['sg']['neut']['nom'] = neut
        forms['sg']['neut']['gen'] = fem[:-1] + 'ού'
        forms['sg']['neut']['acc'] = neut
        forms['sg']['neut']['voc'] = neut
        forms['pl']['masc']['nom'] = fem[:-1] + 'οί'
        forms['pl']['masc']['acc'] = fem[:-1] + 'ούς'
        forms['pl']['masc']['gen'] = fem[:-1] + 'ών'
        forms['pl']['masc']['voc'] = fem[:-1] + 'οί'
        forms['pl']['fem']['nom'] = fem[:-1] + 'ές'
        forms['pl']['fem']['acc'] = fem[:-1] + 'ές'
        forms['pl']['fem']['gen'] = fem[:-1] + 'ών'
        forms['pl']['fem']['voc'] = fem[:-1] + 'ές'
        forms['pl']['neut']['nom'] = fem[:-1] + 'ά'
        forms['pl']['neut']['acc'] = fem[:-1] + 'ά'
        forms['pl']['neut']['gen'] = fem[:-1] + 'ών'
        forms['pl']['neut']['voc'] = fem[:-1] + 'ά'

        return forms, None

    elif masc[-2:] == 'ώς' and fem[-1] == 'α' and neut[-1] == 'ς':
        # archaic participles, not sure which endings to choose, as it seems both are used, ancient and modern (especially in fem),
        # for now I will settle with modernized
        thema = masc[:-1] + 'τ'
        forms['sg']['masc']['nom'] = masc
        forms['sg']['masc']['acc'] = thema + 'α'
        forms['sg']['masc']['gen'] = thema + 'ος'
        forms['sg']['masc']['voc'] = masc
        forms['sg']['fem']['nom'] = fem
        forms['sg']['fem']['acc'] = fem
        forms['sg']['fem']['gen'] = fem + 'ς'
        forms['sg']['fem']['voc'] = fem
        forms['sg']['neut']['nom'] = neut
        forms['sg']['neut']['gen'] = thema + 'ος'
        forms['sg']['neut']['acc'] = neut
        forms['sg']['neut']['voc'] = neut
        forms['pl']['masc']['nom'] = thema + 'ες'
        forms['pl']['masc']['acc'] = thema + 'ες'
        forms['pl']['masc']['gen'] = thema + 'ων'
        forms['pl']['masc']['voc'] = thema + 'ες'
        forms['pl']['fem']['nom'] = fem[:-1] + 'ες'
        forms['pl']['fem']['acc'] = fem[:-1] + 'ες'
        forms['pl']['fem']['gen'] = fem[:-1] + 'ων'
        forms['pl']['fem']['voc'] = fem[:-1] + 'ες'
        forms['pl']['neut']['nom'] = thema + 'α'
        forms['pl']['neut']['acc'] = thema + 'α'
        forms['pl']['neut']['gen'] = thema + 'ων'
        forms['pl']['neut']['voc'] = thema + 'α'

        return forms, None

    elif masc[-2:] in ['ης', 'ής'] and fem[-2:] in [
            'ής', 'ης'
    ] and neut[-2:] in ['ες', 'ές']:
        forms['sg']['masc']['nom'] = masc
        forms['sg']['masc']['gen'] = masc[:-2] + 'ους'
        forms['sg']['masc']['acc'] = masc[:-1]
        forms['sg']['masc']['voc'] = masc[:-1]
        forms['sg']['fem']['nom'] = fem
        forms['sg']['fem']['gen'] = fem[:-2] + 'ους'
        forms['sg']['fem']['acc'] = fem[:-1]
        forms['sg']['fem']['voc'] = fem
        forms['sg']['neut']['nom'] = neut
        forms['sg']['neut']['gen'] = fem[:-2] + 'ους'
        forms['sg']['neut']['acc'] = neut
        forms['sg']['neut']['voc'] = neut

        forms['pl']['masc']['nom'] = masc[:-2] + 'εις'
        forms['pl']['masc']['acc'] = masc[:-2] + 'εις'
        forms['pl']['masc']['gen'] = masc[:-2] + 'ων'
        forms['pl']['masc']['voc'] = masc[:-2] + 'εις'
        forms['pl']['fem']['nom'] = masc[:-2] + 'εις'
        forms['pl']['fem']['acc'] = masc[:-2] + 'εις'
        forms['pl']['fem']['gen'] = masc[:-2] + 'ων'
        forms['pl']['fem']['voc'] = masc[:-2] + 'εις'
        forms['pl']['neut']['nom'] = masc[:-2] + 'η'
        forms['pl']['neut']['acc'] = masc[:-2] + 'η'
        forms['pl']['neut']['gen'] = masc[:-2] + 'ων'
        forms['pl']['neut']['voc'] = masc[:-2] + 'η'

        if where_is_accent(masc) == 'ultimate':
            for num in forms.keys():
                for gender in forms[num].keys():
                    for case, form in forms[num][gender].items():
                        forms[num][gender][case] = put_accent_on_the_ultimate(
                            form)

        return forms, None

    elif masc[-2:] in ['ων', 'ών', 'ας'] and fem[-2:] in [
            'σα'
    ] and neut[-2:] in ['ον', 'όν', 'ύν', 'ών', 'ων', 'αν']:
        # wn, ousa, on and as, asa, an
        feminins = fem.split(',')
        fem = feminins[0]
        neuters = neut.split(',')
        neut = neuters[0]
        thema = neut + 'τ'

        forms['sg']['masc']['nom'] = masc
        forms['sg']['masc']['acc'] = thema + 'α'
        forms['sg']['masc']['gen'] = thema + 'ος'
        forms['sg']['masc']['voc'] = masc
        forms['sg']['fem']['nom'] = fem
        forms['sg']['fem']['acc'] = fem
        forms['sg']['fem']['gen'] = fem + 'ς'
        forms['sg']['fem']['voc'] = fem
        forms['sg']['neut']['nom'] = neut
        forms['sg']['neut']['gen'] = thema + 'ος'
        forms['sg']['neut']['acc'] = neut
        forms['sg']['neut']['voc'] = neut
        forms['pl']['masc']['nom'] = thema + 'ες'
        forms['pl']['masc']['acc'] = thema + 'ες'
        forms['pl']['masc']['gen'] = put_accent_on_the_penultimate(thema +
                                                                   'ων')
        forms['pl']['masc']['voc'] = thema + 'ες'
        forms['pl']['fem']['nom'] = fem[:-1] + 'ες'
        forms['pl']['fem']['acc'] = fem[:-1] + 'ες'
        forms['pl']['fem']['gen'] = put_accent_on_the_ultimate(fem[:-1] + 'ων')
        forms['pl']['fem']['voc'] = fem[:-1] + 'ες'
        forms['pl']['neut']['nom'] = thema + 'α'
        forms['pl']['neut']['acc'] = thema + 'α'
        forms['pl']['neut']['gen'] = put_accent_on_the_penultimate(thema +
                                                                   'ων')
        forms['pl']['neut']['voc'] = thema + 'α'

        alternative_forms = None

        if len(neuters) > 1 and len(feminins) > 1:

            alternative_forms = alternative_forms_wn(
                f'{masc}/{feminins[1]}/{neuters[1]}')

        elif len(neuters) > 1:
            alternative_forms = alternative_forms_wn(
                f'{masc}/{feminins[0]}/{neuters[1]}')

        elif len(feminins) > 1:
            alternative_forms = alternative_forms_wn(
                f'{masc}/{feminins[1]}/{neuters[0]}')

        forms = put_accent_on_unaccented_forms(forms)
        alternative_forms = put_accent_on_unaccented_forms(alternative_forms)

        return forms, alternative_forms

    elif (masc[-4:] == 'ονας' or masc[-2:]
          in ['ών', 'ων']) and fem[-2:] == 'ων' and neut[-2:] == 'ον':

        # ονας, ων, ον
        thema = neut

        forms['sg']['masc']['nom'] = masc
        forms['sg']['masc']['acc'] = thema + 'α'
        forms['sg']['masc']['gen'] = thema + 'α'
        forms['sg']['masc']['voc'] = thema + 'α'
        if masc[-2:] in ['ών', 'ων']:
            forms['sg']['masc']['voc'] = masc
        forms['sg']['fem']['nom'] = fem
        forms['sg']['fem']['acc'] = thema + 'α'
        forms['sg']['fem']['gen'] = thema + 'ος'
        forms['sg']['fem']['voc'] = fem
        forms['sg']['neut']['nom'] = neut
        forms['sg']['neut']['gen'] = thema + 'ος'
        forms['sg']['neut']['acc'] = neut
        forms['sg']['neut']['voc'] = neut

        forms['pl']['masc']['nom'] = thema + 'ες'
        forms['pl']['masc']['acc'] = thema + 'ες'
        forms['pl']['masc']['gen'] = put_accent_on_the_penultimate(thema +
                                                                   'ων')
        forms['pl']['masc']['voc'] = thema + 'ες'
        forms['pl']['fem']['nom'] = thema + 'ες'
        forms['pl']['fem']['acc'] = thema + 'ες'
        forms['pl']['fem']['gen'] = put_accent_on_the_ultimate(thema + 'ων')
        forms['pl']['fem']['voc'] = thema + 'ες'
        forms['pl']['neut']['nom'] = thema + 'α'
        forms['pl']['neut']['acc'] = thema + 'α'
        forms['pl']['neut']['gen'] = put_accent_on_the_penultimate(thema +
                                                                   'ων')
        forms['pl']['neut']['voc'] = thema + 'α'

        alternative_forms = alternative_forms_onas(adj)

        return forms, alternative_forms

    elif masc[-3:] in ['είς'] and fem[-2:] in ['σα'] and neut[-2:] in ['έν']:
        # participles

        thema = neut + 'τ'

        forms['sg']['masc']['nom'] = masc
        forms['sg']['masc']['acc'] = thema + 'α'
        forms['sg']['masc']['gen'] = thema + 'ος'
        forms['sg']['masc']['voc'] = masc
        forms['sg']['fem']['nom'] = fem
        forms['sg']['fem']['acc'] = fem
        forms['sg']['fem']['gen'] = fem + 'ς'
        forms['sg']['fem']['voc'] = fem
        forms['sg']['neut']['nom'] = neut
        forms['sg']['neut']['gen'] = thema + 'ος'
        forms['sg']['neut']['acc'] = neut
        forms['sg']['neut']['voc'] = neut

        forms['pl']['masc']['nom'] = thema + 'ες'
        forms['pl']['masc']['acc'] = thema + 'ες'
        forms['pl']['masc']['gen'] = put_accent_on_the_penultimate(thema +
                                                                   'ων')
        forms['pl']['masc']['voc'] = thema + 'ες'
        forms['pl']['fem']['nom'] = fem[:-1] + 'ες'
        forms['pl']['fem']['acc'] = fem[:-1] + 'ες'
        forms['pl']['fem']['gen'] = put_accent_on_the_ultimate(fem[:-1] + 'ων')
        forms['pl']['fem']['voc'] = fem[:-1] + 'ες'
        forms['pl']['neut']['nom'] = thema + 'α'
        forms['pl']['neut']['acc'] = thema + 'α'
        forms['pl']['neut']['gen'] = put_accent_on_the_penultimate(thema +
                                                                   'ων')
        forms['pl']['neut']['voc'] = thema + 'α'

        alternative_forms = None

        return forms, alternative_forms

    elif masc in ['άρρην'] or (masc[-2:] in ['ων'] and neut[-2:] in ['ον']):
        # ancient 3rd declesion

        thema = neut

        forms['sg']['masc']['nom'] = masc
        forms['sg']['masc']['acc'] = thema + 'α'
        forms['sg']['masc']['gen'] = thema + 'ος'
        forms['sg']['masc']['voc'] = neut
        forms['sg']['fem']['nom'] = fem
        forms['sg']['fem']['acc'] = thema + 'α'
        forms['sg']['fem']['gen'] = thema + 'ος'
        forms['sg']['fem']['voc'] = neut
        forms['sg']['neut']['nom'] = neut
        forms['sg']['neut']['gen'] = thema + 'ος'
        forms['sg']['neut']['acc'] = neut
        forms['sg']['neut']['voc'] = neut

        forms['pl']['masc']['nom'] = thema + 'ες'
        forms['pl']['masc']['acc'] = thema + 'ες'
        forms['pl']['masc']['gen'] = put_accent_on_the_penultimate(thema +
                                                                   'ων')
        forms['pl']['masc']['voc'] = thema + 'ες'
        forms['pl']['fem']['nom'] = thema + 'ες'
        forms['pl']['fem']['acc'] = thema + 'ες'
        forms['pl']['fem']['gen'] = put_accent_on_the_ultimate(fem[:-1] + 'ων')
        forms['pl']['fem']['voc'] = thema + 'ες'
        forms['pl']['neut']['nom'] = thema + 'α'
        forms['pl']['neut']['acc'] = thema + 'α'
        forms['pl']['neut']['gen'] = put_accent_on_the_penultimate(thema +
                                                                   'ων')
        forms['pl']['neut']['voc'] = thema + 'α'

        return forms, None

    elif masc[-2:] == 'ις' and masc == fem and neut == '-':
        # ancient 3rd declesion
        thema = masc[:-1] + 'δ'

        forms['sg']['masc']['nom'] = masc
        forms['sg']['masc']['acc'] = thema + 'α'
        forms['sg']['masc']['gen'] = thema + 'ος'
        forms['sg']['masc']['voc'] = masc
        forms['sg']['fem']['nom'] = masc
        forms['sg']['fem']['acc'] = thema + 'α'
        forms['sg']['fem']['gen'] = thema + 'ος'
        forms['sg']['fem']['voc'] = masc

        forms['pl']['masc']['nom'] = thema + 'ες'
        forms['pl']['masc']['acc'] = thema + 'ες'
        forms['pl']['masc']['gen'] = put_accent_on_the_penultimate(thema +
                                                                   'ων')
        forms['pl']['masc']['voc'] = thema + 'ες'
        forms['pl']['fem']['nom'] = thema + 'ες'
        forms['pl']['fem']['acc'] = thema + 'ες'
        forms['pl']['fem']['gen'] = put_accent_on_the_ultimate(thema + 'ων')
        forms['pl']['fem']['voc'] = thema + 'ες'

        forms = put_accent_on_antepenultimate_in_all_forms(masc, forms)
        return forms, None

    elif masc[-1:] in ['ξ', 'ψ'] and masc == fem and neut == '-':
        # ancient 3rd declesion
        thema = masc[:-1] + 'κ'
        if masc[-4:] == 'θριξ':
            thema = masc[:-4] + 'τριχ'
        elif masc[-3:] == 'φυξ':
            thema = masc[:-3] + 'φυγ'
        elif masc[-1] == 'ψ':
            thema = masc[:-1] + 'π'

        forms['sg']['masc']['nom'] = masc
        forms['sg']['masc']['acc'] = thema + 'α'
        forms['sg']['masc']['gen'] = thema + 'ος'
        forms['sg']['masc']['voc'] = masc
        forms['sg']['fem']['nom'] = masc
        forms['sg']['fem']['acc'] = thema + 'α'
        forms['sg']['fem']['gen'] = thema + 'ος'
        forms['sg']['fem']['voc'] = masc

        forms['pl']['masc']['nom'] = thema + 'ες'
        forms['pl']['masc']['acc'] = thema + 'ες'
        forms['pl']['masc']['gen'] = put_accent_on_the_penultimate(thema +
                                                                   'ων')
        forms['pl']['masc']['voc'] = thema + 'ες'
        forms['pl']['fem']['nom'] = thema + 'ες'
        forms['pl']['fem']['acc'] = thema + 'ες'
        forms['pl']['fem']['gen'] = put_accent_on_the_ultimate(thema + 'ων')
        forms['pl']['fem']['voc'] = thema + 'ες'

        forms = put_accent_on_antepenultimate_in_all_forms(masc, forms)
        return forms, None

    elif masc[-2:] == 'ας' and fem[-2:] == 'να' and neut[-2:] == 'αν':
        """
        not a very often occurrence: ancient type of melas, melaina, melan
        """
        thema = neut
        fem_thema = fem[:-1]
        forms['sg']['masc']['nom'] = masc
        forms['sg']['masc']['acc'] = thema + 'α'
        forms['sg']['masc']['gen'] = thema + 'ος'
        forms['sg']['masc']['voc'] = neut
        forms['sg']['fem']['nom'] = fem
        forms['sg']['fem']['acc'] = fem
        forms['sg']['fem']['gen'] = fem + 'ς'
        forms['sg']['fem']['voc'] = fem
        forms['sg']['neut']['nom'] = neut
        forms['sg']['neut']['gen'] = thema + 'ος'
        forms['sg']['neut']['acc'] = neut
        forms['sg']['neut']['voc'] = neut

        forms['pl']['masc']['nom'] = thema + 'ες'
        forms['pl']['masc']['acc'] = thema + 'ες'
        forms['pl']['masc']['gen'] = put_accent_on_the_penultimate(thema +
                                                                   'ων')
        forms['pl']['masc']['voc'] = thema + 'ες'
        forms['pl']['fem']['nom'] = fem_thema + 'ες'
        forms['pl']['fem']['acc'] = fem_thema + 'ες'
        forms['pl']['fem']['gen'] = put_accent_on_the_ultimate(fem_thema +
                                                               'ων')
        forms['pl']['fem']['voc'] = fem_thema + 'ες'
        forms['pl']['neut']['nom'] = thema + 'α'
        forms['pl']['neut']['acc'] = thema + 'α'
        forms['pl']['neut']['gen'] = put_accent_on_the_penultimate(thema +
                                                                   'ων')
        forms['pl']['neut']['voc'] = thema + 'α'

        return forms, None

    elif masc[-2:] == 'ις' and fem == masc and neut[-1] == 'ι':

        thema = neut + 'τ'
        fem_thema = thema
        forms['sg']['masc']['nom'] = masc
        forms['sg']['masc']['acc'] = thema + 'α'
        forms['sg']['masc']['gen'] = thema + 'ος'
        forms['sg']['masc']['voc'] = neut
        forms['sg']['fem']['nom'] = fem
        forms['sg']['fem']['acc'] = thema + 'α'
        forms['sg']['fem']['gen'] = thema + 'ος'
        forms['sg']['fem']['voc'] = thema
        forms['sg']['neut']['nom'] = neut
        forms['sg']['neut']['gen'] = thema + 'ος'
        forms['sg']['neut']['acc'] = neut
        forms['sg']['neut']['voc'] = neut

        forms['pl']['masc']['nom'] = thema + 'ες'
        forms['pl']['masc']['acc'] = thema + 'ες'
        forms['pl']['masc']['gen'] = put_accent_on_the_penultimate(thema +
                                                                   'ων')
        forms['pl']['masc']['voc'] = thema + 'ες'
        forms['pl']['fem']['nom'] = fem_thema + 'ες'
        forms['pl']['fem']['acc'] = fem_thema + 'ες'
        forms['pl']['fem']['gen'] = put_accent_on_the_ultimate(fem_thema +
                                                               'ων')
        forms['pl']['fem']['voc'] = fem_thema + 'ες'
        forms['pl']['neut']['nom'] = thema + 'α'
        forms['pl']['neut']['acc'] = thema + 'α'
        forms['pl']['neut']['gen'] = put_accent_on_the_penultimate(thema +
                                                                   'ων')
        forms['pl']['neut']['voc'] = thema + 'α'

        forms = put_accent_on_antepenultimate_in_all_forms(masc, forms)

        return forms, None

    elif masc[-2:] == 'ως' and fem == masc and neut[-2:] == 'ων':

        thema = neut[:-2]

        forms['sg']['masc']['nom'] = masc
        forms['sg']['masc']['acc'] = masc[:-1]
        forms['sg']['masc']['gen'] = neut
        forms['sg']['masc']['voc'] = masc
        forms['sg']['fem']['nom'] = fem
        forms['sg']['fem']['acc'] = fem[:-1]
        forms['sg']['fem']['gen'] = neut
        forms['sg']['fem']['voc'] = masc
        forms['sg']['neut']['nom'] = neut
        forms['sg']['neut']['gen'] = neut[:-1]
        forms['sg']['neut']['acc'] = neut
        forms['sg']['neut']['voc'] = neut

        forms['pl']['masc']['nom'] = thema + 'ῳ'
        forms['pl']['masc']['acc'] = thema + 'ῳς'
        forms['pl']['masc']['gen'] = thema + 'ων'
        forms['pl']['masc']['voc'] = thema + 'ῳ'
        forms['pl']['fem']['nom'] = thema + 'ῳ'
        forms['pl']['fem']['acc'] = thema + 'ῳς'
        forms['pl']['fem']['gen'] = thema + 'ῳν'
        forms['pl']['fem']['voc'] = thema + 'ῳ'
        forms['pl']['neut']['nom'] = thema + 'α'
        forms['pl']['neut']['acc'] = thema + 'α'
        forms['pl']['neut']['gen'] = thema + 'ων'
        forms['pl']['neut']['voc'] = thema + 'α'

        forms = put_accent_on_antepenultimate_in_all_forms(masc, forms)

        return forms, None

    else:
        for number in forms.keys():
            for gender in forms[number].keys():
                for case in forms[number][gender].keys():
                    forms[number][gender][case] = masc

        return forms, None