|
From: <fri...@us...> - 2008-12-23 19:24:47
|
Revision: 9633
http://zaf.svn.sourceforge.net/zaf/?rev=9633&view=rev
Author: friedelwolff
Date: 2008-12-23 19:24:42 +0000 (Tue, 23 Dec 2008)
Log Message:
-----------
Expand some comments and docstrings. Slight whitespace cleanup.
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-23 18:39:15 UTC (rev 9632)
+++ trunk/dict/zu/hunspell/zu_aff.py 2008-12-23 19:24:42 UTC (rev 9633)
@@ -3,7 +3,7 @@
#
# Copyright 2008 Friedel Wolff
#
-# This file is part of Virtaal.
+# This file is part of the Zulu spell checker for Hunspell.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -18,8 +18,20 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
-"""This module creates an affix file for a Zulu spell checker."""
+"""This module creates an affix file for a Zulu spell checker.
+Done:
+ - frequency list (TRY)
+ - replacement map (REP)
+"""
+
+# This currently only handles morphology for verbs. More to follow later.
+
+#TODO: be- and se- verbs
+#TODO: monosyllabic verbs
+#TODO: statives
+#TODO: auxilary verbs
+
from hunspell_format import *
import re
@@ -114,11 +126,10 @@
return True
return False
-
def add_semivowels(prefix):
"""Handle the insertion of semi-vowels (y or w) between vowels."""
prefix = re.sub(r"([aeiou])a", r"\1wa", prefix)
- #TODO: maybe iya?
+ #TODO: maybe iya? (would this even be used with iya?)
prefix = re.sub(r"([aeiou])i", r"\1yi", prefix)
prefix = re.sub(r"([aeiou])u", r"\1wu", prefix)
return prefix
@@ -166,7 +177,7 @@
#example: i + enza = yenza
#
#otherwise, change 'i' to 'y'
- if len(prefix) > 1:
+ if len(prefix) > 1:
prefix = prefix[0:-1]
changed.append(["y", prefix, "y[^i]"])
#changed.append(["y", prefix, "y"])
@@ -188,11 +199,10 @@
if prefix[-1] == "e":
#TODO: situative e- and be- should be handled (entirely thrown away?).
#We can probably just generate them, and duplicate handling should take
- #care of them.
+ #care of them. Then we need to handle relatives with ending on e.
pass
return changed
-
################################################################################
for i in concords:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|