|
From: <fri...@us...> - 2009-02-26 08:09:38
|
Revision: 9675
http://zaf.svn.sourceforge.net/zaf/?rev=9675&view=rev
Author: friedelwolff
Date: 2009-02-26 08:09:35 +0000 (Thu, 26 Feb 2009)
Log Message:
-----------
Far more complete implementation of locatives with better comments. Now there is support for e-, nase-, ngase-, njengase- prefixes, as well as copulatives before the locatives (such as usekhaya), and possessives with locatives (such as sasekhaya)
Modified Paths:
--------------
trunk/dict/zu/hunspell/zu_aff.py
Modified: trunk/dict/zu/hunspell/zu_aff.py
===================================================================
--- trunk/dict/zu/hunspell/zu_aff.py 2009-02-25 07:31:56 UTC (rev 9674)
+++ trunk/dict/zu/hunspell/zu_aff.py 2009-02-26 08:09:35 UTC (rev 9675)
@@ -41,8 +41,6 @@
#TODO: noun continuation class for infinitive+obj and negative infinitives?
#NOUNS:
-#TODO: locatives
-#TODO: locatives of class 1
#TODO: possessive of class 1
#TODO: review possessive of class 2a
@@ -261,6 +259,18 @@
print >> sys.stderr, "got an unexpected noun prefix:", prefix
return group.rules
+def locative_rules(group, **kwargs):
+ """Generate the necessary rules to prepend the given prefix to a noun as
+ part of forming a locative.
+
+ This is really only for the very common cases with locative prefixes
+ ending with e-."""
+ prefix = kwargs.pop('affix')
+ group.add_rule(affix=prefix, strip="a", **kwargs)
+ group.add_rule(affix=prefix, strip="i", **kwargs)
+ group.add_rule(affix=prefix, strip="u", **kwargs)
+ return group.rules
+
################################################################################
for i in concords:
@@ -422,17 +432,33 @@
noun = aff.add_group(suffix=False, flag="N")
# This group will contain most prefixes for nouns
- locative_e_ini = aff.add_group(suffix=False, flag="M")
+ locative_e = aff.add_group(suffix=False, flag="O")
+ # This group will contain rules for locative prefixes in the form e- (no -ini)
+ # This is used for some nouns, especially loan words. Examples: ikhaya,
+ # iGoli
+
+ locative_e_ini = aff.add_group(suffix=False, flag="P")
# This group will contain rules for locative prefixes in the form e...ini
+ # This is used for most nouns, such as amanzi, ukuqala
- locative_o_ini = aff.add_group(suffix=False, flag="O")
+ locative_o_ini = aff.add_group(suffix=False, flag="Q")
# This group will contain rules for locative prefixes in the form o...ini
+ # This can be used for class 11 nouns, and for a few words in class 14,
+ # such as utshani and utshwala
- locative_ku = aff.add_group(suffix=False, flag="P")
- # This group will contain rules for locative prefixes with the prefix ku- and kwa-
+ locative_ku = aff.add_group(suffix=False, flag="R")
+ # This group will contain rules for locative prefixes with the prefix ku-
+ # This is needed for class 1, 1a, 2, 2a, and some groups of class 6, like
+ # amaXhosa
- locative_kwi = aff.add_group(suffix=False, flag="Q")
+ locative_kwa = aff.add_group(suffix=False, flag="S")
+ # This group will contain rules for locative prefixes with the prefix kwa-
+ # This can apply to several nouns, but is indistinguishable from the
+ # possessive of class 15 (ku+a+...)
+
+ locative_kwi = aff.add_group(suffix=False, flag="T")
# This group will contain rules for locative prefixes with the prefix kwi-
+ # This is used acronymns, proper names of organisations, loan words
locative_sfx_ini = aff.add_group(suffix=True, flag="m")
# This group will contain rules for locative suffixes
@@ -571,9 +597,36 @@
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_e_ini.add_rule(affix="e", strip="u", morphology="LOC_pfx", circumfix=True, continuation_classes=[locative_sfx_ini])
+ for prefix, morphology in [
+ ("e", "LOC_pfx"),
+ ("nase", "ASSOCIATIVE_COPULATIVE+LOC_pfx"),
+ ("ngase", "INSTRUMENTAL/REFERENTIAL_PARTICLE+LOC_pfx"),
+ ("njengase", "COMPARATIVE_PARTICLE+LOC_pfx"), #rare
+ ]:
+ locative_rules(locative_e, affix=prefix, morphology=morphology)
+ locative_rules(locative_e_ini, affix=prefix, morphology=morphology, circumfix=True, continuation_classes=[locative_sfx_ini])
+ for prefix in [morpheme + "se" for morpheme in subject_morphemes]:
+ locative_rules(locative_e, affix=prefix, morphology="COPULATIVE+LOC_pfx")
+ locative_rules(locative_e_ini, affix=prefix, morphology="COPULATIVE+LOC_pfx", circumfix=True, continuation_classes=[locative_sfx_ini])
+
+ for prefix in [morpheme + "se" for morpheme in possesive_morphemes]:
+ locative_rules(locative_e, affix=prefix, morphology="POSSESSIVE+LOC_pfx")
+ locative_rules(locative_e_ini, affix=prefix, morphology="POSSESSIVE+LOC_pfx", circumfix=True, continuation_classes=[locative_sfx_ini])
+
+ locative_o_ini.add_rule(affix="o", strip="u", morphology="LOC_pfx", circumfix=True, continuation_classes=[locative_sfx_ini])
+ locative_ku.add_rule(affix="ku", strip="a", morphology="LOC_pfx")
+ locative_ku.add_rule(affix="ku", strip="u", morphology="LOC_pfx")
+ locative_ku.add_rule(affix="ko", condition="o", morphology="LOC_pfx")
+ locative_kwa.add_rule(affix="kwa", strip="a", morphology="LOC_pfx")
+ locative_kwa.add_rule(affix="kwa", strip="u", morphology="LOC_pfx")
+ locative_kwi.add_rule(affix="kw", condition="i", morphology="LOC_pfx")
+
+ locative_sfx_ini.add_rule(affix="ni", condition="i", circumfix=True, morphology="LOC_sfx")
+ locative_sfx_ini.add_rule(affix="eni", strip="e", circumfix=True, morphology="LOC_sfx")
locative_sfx_ini.add_rule(affix="eni", strip="a", circumfix=True, morphology="LOC_sfx")
+ locative_sfx_ini.add_rule(affix="weni", strip="o", circumfix=True, morphology="LOC_sfx")
+ locative_sfx_ini.add_rule(affix="wini", strip="u", circumfix=True, morphology="LOC_sfx")
### Nouns ###
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|