|
From: <fri...@us...> - 2008-12-24 05:37:57
|
Revision: 9635
http://zaf.svn.sourceforge.net/zaf/?rev=9635&view=rev
Author: friedelwolff
Date: 2008-12-24 05:37:54 +0000 (Wed, 24 Dec 2008)
Log Message:
-----------
Comment out the current rules generation, and rater implement a plain skeleton that was tested manually with hunspell. This implements a few examples of several features, and hopefully these classes are close to what we'll need.
Modified Paths:
--------------
trunk/dict/zu/hunspell/zu_aff.py
Modified: trunk/dict/zu/hunspell/zu_aff.py
===================================================================
--- trunk/dict/zu/hunspell/zu_aff.py 2008-12-24 05:34:59 UTC (rev 9634)
+++ trunk/dict/zu/hunspell/zu_aff.py 2008-12-24 05:37:54 UTC (rev 9635)
@@ -328,11 +328,74 @@
aff.needaffix = "Y"
aff.complexprefixes = True
- for rule_set in rules:
- flag, cross_product, type = rule_set[0]
- group = aff.add_group(suffix=type=="SFX", cross_product=cross_product, flag=flag)
- for rule in rule_set[1:]:
- strip, affix, condition = rule
- group.add_rule(strip=strip, affix=affix, condition=condition)
+# for rule_set in rules:
+# flag, cross_product, type = rule_set[0]
+# group = aff.add_group(suffix=type=="SFX", cross_product=cross_product, flag=flag)
+# for rule in rule_set[1:]:
+# strip, affix, condition = rule
+# group.add_rule(strip=strip, affix=affix, condition=condition)
+ main_subjects = aff.add_group(suffix=False, flag="B")
+ # This group will contain all the major subject morphemes
+
+ simple_subjects = aff.add_group(suffix=False, flag="s")
+ # This group will contain plain positive indicate subject morphemes that
+ # can combine with -ya-. This will duplicate some contents of main_subjects.
+
+ infixes = aff.add_group(suffix=False, flag="C")
+ # This group will contain all prefix groups inserted between the subject
+ # morpheme and the root. Combinations will be compacted as one prefix.#
+ # These rules will in most cases be dependent on combining with other rules
+ # such as those in main_subjects
+
+ past_indicative = aff.add_group(suffix=True, flag="d")
+ # This group contains the suffixes for the past indicative (positive)
+
+ negative_indicative = aff.add_group(suffix=True, flag="e")
+ # This groups contains the suffixes for the negative indicative (future and
+ # present)
+
+ imperative = aff.add_group(suffix=True, flag="F")
+ # This contains suffixes for imperative mode
+
+ question = aff.add_group(suffix=True, flag="I")
+ # This group contains rules for forming question words
+
+ locative = aff.add_group(suffix=False, flag="N")
+ # This group will contain rules for locative prefixes
+
+ locative_sfx = aff.add_group(suffix=True, flag="M")
+ # This group will contain rules for locative suffixes
+
+ main_subjects.add_rule(affix="ngi", morphology="1st_person", continuation_classes=[past_indicative, question])
+ main_subjects.add_rule(affix="angi", morphology="1st_person_NEG", needaffix=True, circumfix=True, continuation_classes=[negative_indicative])
+
+ simple_subjects.add_rule(affix="ngi", morphology="1st_person_flag_s")
+
+ infixes.add_rule(affix="ya", needaffix=True, morphology="PRESENT_IND_LONG", continuation_classes=[simple_subjects])
+ infixes.add_rule(affix="yaku", needaffix=True, morphology="PRESENT_IND_LONG_OBJ_ku", continuation_classes=[simple_subjects])
+ infixes.add_rule(affix="sa", needaffix=True, morphology="STILL", continuation_classes=[main_subjects])
+ infixes.add_rule(affix="ku", needaffix=True, morphology="OBJ_ku", continuation_classes=[main_subjects])#
+ infixes.add_rule(affix="saku", needaffix=True, continuation_classes=[main_subjects])
+ infixes.add_rule(affix="uku", morphology="INFINITIVE", continuation_classes=[locative])
+ infixes.add_rule(affix="", morphology="IMPERATIVE", continuation_classes=[imperative])
+
+ past_indicative.add_rule(affix="e", strip="a", morphology="RECENT_PAST_IND_SHORT")
+ past_indicative.add_rule(affix="ile", strip="a", morphology="RECENT_PAST_IND_LONG")
+
+ negative_indicative.add_rule(affix="i", circumfix=True, strip="a", morphology="PRESENT_IND_NEGATIVE")
+ negative_indicative.add_rule(affix="nga", circumfix=True, morphology="PAST_IND_NEGATIVE")
+
+ imperative.add_rule(affix="ni", condition="a", morphology="IMPERATIVE_(PLURAL)")
+
+ question.add_rule(affix="ni", morphology="Q_what")
+ question.add_rule(affix="phi", morphology="Q_where")
+ question.add_rule(affix="elani", strip="a", condition="a", morphology="Q_PRESENT_why")
+ question.add_rule(affix="eleni", strip="a", condition="a", morphology="Q_PAST_why")
+
+ locative.add_rule(affix="e", strip="u", morphology="LOC_pfx", circumfix=True, continuation_classes=[locative_sfx])
+
+ locative_sfx.add_rule(affix="eni", strip="a", circumfix=True, morphology="LOC_sfx")
+
+
print aff.hunspell()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|