Alphabet ա ե է ը ո օ ի լ բ գ դ զ թ ժ խ ծ կ հ ձ ղ ճ մ յ ն շ չ պ ջ ռ ս վ տ ր ց ւ փ ք ֆ Ա Ե Է Ը Ո Օ Ի Լ Բ Գ Դ Զ Թ Ժ Խ Ծ Կ Հ Ձ Ղ Ճ Մ Յ Ն Շ Չ Պ Ջ Ռ Ս Վ Տ Ր Ց Ւ Փ Ք Ֆ %{յ%}:յ !stable glide that cant be deleted at end of words ՚ !apostrophe ՜:՜ !punctuation from the infixial file that's added to every word ՞:՞ ՛:՛ %{՜%} ! irregular punctuation inside lexical entries %{՞%} %{՛%} !other punctuation symbols %- ֊ – — , ՝ ։ . ' « » %( %) ՚ ՟ … ՙ % %{G1%}:ը %{G2%}:% %{N1%}:ի %{N2%}:% %{ThAյ%}:0 %{լ%}:լ %{ProhPl%}:0 %{ImpSg%}:0 %{Aor%}:0 %{Impf%}:0 %{Pres3SG%}:0 %{Pres2PL%}:0 %{NegPtcpHye%}:0 %{PossPlի%}:ի ! The plural possessive generally surfaces with ի unless before a vowel %{SpurPlե%}:0 ! Spurious plural is deleted unless after monosyllables %{SpurPlր%}:0 %{defն%}:ը ! for definite allomorphy ն-ը; i assume easier default is ը %{Plն%}:ն !for plural allomorphy եր ներ; I assume easier default is polysyllabic ներ %{Ninfl%}:0 ! Boundary between noun and inflection %{NinflRed%}:0 ! Boundary between noun and inflection, for obligatory reduction %{NinflRedForcedNer%}:0 ! Boundary between noun and -ner suffix, obligatory reduction in some lexemes %{mono%}:0 ! This is boundary before a monosyllabic root to trigger the right plural ; Sets InfixPunctAdded = ՜ ՞ ՛ ; InfixPunctLexical = %{՜%} %{՞%} %{՛%} ; Vowel = ա ե է ը ո օ ի Ա Ե Է Ը Ո Օ Ի ; NonSchwaVowel = ա ե է ո օ ի Ա Ե Է Ո Օ Ի ; Cons = բ գ դ զ թ ժ լ խ ծ կ հ ձ ղ ճ մ յ ն շ չ պ ջ ռ ս վ տ ր ց ւ փ ք ֆ Բ Գ Դ Զ Թ Ժ Լ Խ Ծ Կ Հ Ձ Ղ Ճ Մ Յ Ն Շ Չ Պ Ջ Ռ Ս Վ Տ Ր Ց Ւ Փ Ք Ֆ ; !Noun-infl boundaries GeneralNInflBoundary = %{Ninfl%} %{NinflRed%} ; !Summary of contexts ե theme vowel becomes է in Hyw JeToE = %{ProhPl%} %{Pres3SG%} %{ImpSg%} %{Impf%} %{Pres2PL%} ; !Summary of contexts ե theme vowel becomes ի in Hye JeToI = %{Pres3SG%} %{NegPtcpHye%} ; ! Some contexts where ի theme vowel becomes է (ի only in hyw) IToE = %{ImpSg%} %{Impf%} ; ! Some contexts where ի theme vowel becomes ե (ի only in hyw) IToJe = %{Aor%} ; ! Summary of contexts where ա theme vowel becomes այ AtoAJ = %{Pres3SG%} ; Definitions FullVowel = [ :ա | :ե | :է | :ո | :օ | :ի | :ո :ւ | :Ա | :Ե | :Է | :Ո | :Օ | :Ի | :Ո :Ւ ] ; RealVowel = [ FullVowel | :ը | :Ը ]; RealVowelUR = [ ա: | ե: | է: | ո: | օ: | ի: | ո: ւ: | ը: | Ա: | Ե: | Է: | Ո: | Օ: | Ի: | Ո: Ւ: | Ը:] ; ! For finding monosyllables, I have to specify monosyllabic words with schwa ! because of conflicts with vowel reduction ! Also has to reference underlyng segments because of conflicts with other rules MonosyllableWithoutSchwa = .#. (Cons: ([յ:|ե:])) RealVowelUR (Cons: (Cons:)) (ք:) ; MonosyllableWithSchwa = .#. Cons: (Cons:) (Cons:) ; Monosyllable = [ MonosyllableWithoutSchwa | MonosyllableSchwa ]; ; Rules !!!!! AFFIX ALLOMORPHY !Indicative prefix /կ{G1}{G2}/ is [կը ] before C's and [կ՚] before V's !Complication is that ու is a vowel while ոX is not "For G1, prefix կ{G1}{G2} to [կ՚] before a vowel" %{G1%}:՚ <=> _ %{G2%}: [ [ :Vowel - :ո ] | :ո :ւ ] ; "For G2, prefix կ{G1}{G2} to կ՚ before a vowel" %{G2%}:0 <=> _ [ [ :Vowel - :ո ] | :ո :ւ ] ; !"For G1, prefix կ{G1}{G2} to [կը ] before a consonant" !%{G1%}:ը <=> _ %{G2%}: [ [ :Cons ] | [ :ո - [ :ո :ւ ] ] ] ; !"For G2, prefix կ{G1}{G2} to [կը ] before a consonant" !%{G2%}:% <=> _ [ [ :Cons ] | [ :ո - [ :ո :ւ ] ] ] ; !Negative prefix /չ{N1}{N2}/ is [չի ] before C's and [չ՚] before V's !Complication is that ու is a vowel while ոX is not "For N1, prefix չ{N1}{N2} to [չ՚] before a vowel" %{N1%}:՚ <=> _ %{N2%}: [ [ :Vowel - :ո ] | :ո :ւ ] ; "For N2, prefix չ{N1}{N2} to չ՚ before a vowel" %{N2%}:0 <=> _ [ [ :Vowel - :ո ] | :ո :ւ ] ; !"For N1, prefix չ{N1}{N2} to [կի ] before a consonant" !%{N1%}:ի <=> _ %{N2%}: [ [ :Cons ] | [ :ո - [ :ո :ւ ] ] ] ; !"For N2, prefix չ{N1}{N2} to [կի ] before a consonant" !%{N2%}:% <=> _ [ [ :Cons ] | [ :ո - [ :ո :ւ ] ] ] ; !!!! GLIDE EPENTHESIS !The glide յ is added between the ա theme vowel and pres3sg in hyw + imperfective-i "The glide յ between the ա theme vowel and before 3sg: /ա{ThAյ}Pres/ -> [այ]" ! Var/hyw %{ThAյ%}:յ <=> ա: _ [ %{Pres3SG%}: ] ; ! Var/hyw "The glide յ between the ա theme vowel and before imperfect ի: /ա{ThAյ}{Impf}ի/ -> [այի]" %{ThAյ%}:յ <=> ա: _ [ %{Impf%}: :ի ] ; !!!!! THEME VOWEL CHANGES !In many contexts, the ի theme vowel becomes է ! These contexts are part of IToE "theme vowel /իIToE/ to [է]" ի:է <=> _ 0:* IToE: ; !!In many contexts, the ե theme vowel becomes է in hyw ! These contexts are part of JeToE "theme vowel /ե{JeToE}/ to [է] in hyw" ! Var/hyw ե:է <=> _ 0:* JeToE: ; ! Var/hyw !!In many contexts, the ե theme vowel becomes ի in in hye "theme vowel /ե{JeToI}/ to [ի] in hye" ! Var/hye ե:ի <=> _ 0:* JeToI: ; ! Var/hye !In some contexts, the ի theme vowel becomes ե ! These contexts are part of IToJe "theme vowel /իIToJe}/ to [ե]" ի:ե <=> _ 0:* IToJe: ; !When there's a full vowel after the infinitival, the ի theme vowel becomes ե !Needed finessing in order to apply across zero morphs and consonants liek նի "theme vowel /ի{լ}V/ to [ե]" ի:ե <=> _ %{լ%}: [ :0 | :Cons ]* FullVowel ; !When there's a full vowel after the infinitival, the ու theme vowel becomes ե "theme vowel /ու/ to [ե]" ո:ե <=> _ ւ:0 %{լ%}: [ :0 | :Cons ]* FullVowel ; "theme vowel /ու/ to [ե]" ւ:0 <=> _ %{լ%}: [ :0 | :Cons ]* FullVowel ; !!!!!!!!!!!!!!!!!!!!!! !!! Noun allomorphy ! For definite allomorphy, the input definite suffix is %{defն%} ! It's a ն after/before vowels, ը elsewhere ! Need the :0* context because of deleted glides ! Need the ու line because of infixal punctuation creating *բո՝ւը "definite suffix is ն after/before vowels" %{defն%}:ն <=> RealVowel (:0|:InfixPunctAdded)* _ ; :ո (:0|:InfixPunctAdded)* :ւ _ ; _ (:0|:InfixPunctAdded)* RealVowel ; _ (:0|:InfixPunctAdded)* :ո (:0|:InfixPunctAdded)* :ւ ; ! For plural allomorphy, the input plural suffix is %{Plն%}եր ! The rule will drop %{Plն%} after monosyllables, defined roughty as maximally CJVCCk !The suffix is -er also after monosyllabic-headed compounds !I assume that the right compounds end in a {mono} diacritic "plural suffix is եր after monosyllables and after monosyllabic-headed compounds" %{Plն%}:0 <=> Monosyllable :0* _ ; %{mono%}: :0* _ ; ! For plural possessive allomorphy, there is a fake plural suffix եր if after monosyllable ! The rule will turn the relevant diacritics into the plural suffix !Same for compounds with monosyllabic head "spurious plural suffix is եր after monosyllables and mono-head compounds: for ե" %{SpurPlե%}:ե <=> Monosyllable :0* _ ; %{mono%}: :0* _ ; "spurious plural suffix is եր after monosyllables and mono-head compounds: for ր" %{SpurPlր%}:ր <=> Monosyllable :0* %{SpurPlե%}:ե _ ; %{mono%}: :0* %{SpurPlե%}:ե _ ; ! For plural possessive allomorphy, the suffix loses ի before a vowel "Delete the vowel ի of the plural possessive before a vowel է ո ի " %{PossPlի%}:0 <=> _ [:է | :ո | :ի ]; !!!!!!!!!!!!!!!! !!!! Destressed reduction ! In nouns, if the last stem vowel is ի or ու, then it is deleted in the orthography if ! It precedes a vowel-initial inflectional suffix ! I capture that by using a morpheme boundary %{NinflRed%} that's only found ! between nouns and inflection for reduction ! Doesn't target word-initial vowels in the orthography "Delete ի if before a vowel-initial suffix, with 1 or more consonants between them; can be forced before -ner in some lexemes" ի:0 <=> _ :Cons :Cons* (:0)* %{NinflRed%}: (:0)* FullVowel ; _ :Cons :Cons* (:0)* %{NinflRedForcedNer%}: ; except .#. (:0)* _ ; "Delete ու if before a vowel-initial suffix, with 1 or more consonants between them (part 1); can be forced before -ner in some lexemes" ո:0 <=> _ ւ: :Cons :Cons* (:0)* %{NinflRed%}: (:0)* FullVowel ; _ ւ: :Cons :Cons* (:0)* %{NinflRedForcedNer%}: ; except .#. (:0)* _ ; "Delete ու if before a vowel-initial suffix, with 1 or more consonants between them (part 2); can be forced before -ner in some lexemes" ւ:0 <=> ո: _ :Cons :Cons* (:0)* %{NinflRed%}: (:0)* FullVowel ; ո: _ :Cons :Cons* (:0)* %{NinflRedForcedNer%}: ; except .#. (:0)* ո: _ ; !!!!!!!!! !! glide deletion in nouns ! The glide յ is deleted when a) it follows ա or ո, b) it's before nominal suffixes ! and c) the suffix is consonantal-initial ! But not for monosyllabic nouns ! It's deleted before definite suffix "Delete glide յ in the context ա/ո _ C-initial suffix " յ:0 <=> :ա (:0|:InfixPunctAdded)* _ (:0|:InfixPunctAdded)* GeneralNInflBoundary: (:0|:InfixPunctAdded)* :Cons ; :ա (:0|:InfixPunctAdded)* _ (:0|:InfixPunctAdded)* GeneralNInflBoundary: (:0|:InfixPunctAdded)* %{defն%}: ; :ո (:0|:InfixPunctAdded)* _ (:0|:InfixPunctAdded)* GeneralNInflBoundary: (:0|:InfixPunctAdded)* :Cons ; :ո (:0|:InfixPunctAdded)* _ (:0|:InfixPunctAdded)* GeneralNInflBoundary: (:0|:InfixPunctAdded)* %{defն%}: ; except Monosyllable (:0|:InfixPunctAdded)* _ ; _ (:0|:InfixPunctAdded)* %{mono%}: ; !! glide epenthesis in nouns ! The glide յ is added when a) it follows ա ո օ , b) it's before nominal suffixes ! and c) the suffix is vowel-initial ! It's absent before definite suffix "Insert glide յ in the context ա _ V-initial suffix " 0:յ <=> :ա _ :0* GeneralNInflBoundary: :0* RealVowelUR ; :ո _ :0* GeneralNInflBoundary: :0* RealVowelUR ; :օ _ :0* GeneralNInflBoundary: :0* RealVowelUR ; ! except ! Monosyllable :0* _ ; !not sure if this except clause does anything ! %{mono%}: :0* _ ; ! :ա _ :0* GeneralNInflBoundary: :0* %{defն%}: ; !! o changes for grapheme <ո> <օ> in nouns ! The grapheme օ becomes ո a) it's before nominal suffixes ! and b) the suffix is vowel-initial ! Have to add caveat that a glide intervenes on the surface "Change symbol օ to ո context օ _ V-initial suffix " օ:ո <=> _ :0* :յ :0* GeneralNInflBoundary: :0* RealVowelUR ; ! ! Resources: ! https://wiki.apertium.org/wiki/Starting_a_new_language_with_HFST#Enter_twol ! https://kitwiki.csc.fi/twiki/bin/view/KitWiki/HfstHome ! https://github.com/hfst/ ! https://wiki.apertium.org/wiki/Twol ! https://wiki.apertium.org/wiki/Hfst