A list of rules based on word morphology (prefix, suffix).
(self, lexicon={}, path="")
| 257 | class Morphology(lazylist, Rules): |
| 258 | |
| 259 | def __init__(self, lexicon={}, path=""): |
| 260 | """ A list of rules based on word morphology (prefix, suffix). |
| 261 | """ |
| 262 | cmd = ("char", # Word contains x. |
| 263 | "haspref", # Word starts with x. |
| 264 | "hassuf", # Word end with x. |
| 265 | "addpref", # x + word is in lexicon. |
| 266 | "addsuf", # Word + x is in lexicon. |
| 267 | "deletepref", # Word without x at the start is in lexicon. |
| 268 | "deletesuf", # Word without x at the end is in lexicon. |
| 269 | "goodleft", # Word preceded by word x. |
| 270 | "goodright", # Word followed by word x. |
| 271 | ) |
| 272 | cmd = dict.fromkeys(cmd, True) |
| 273 | cmd.update(("f" + k, v) for k, v in cmd.items()) |
| 274 | Rules.__init__(self, lexicon, cmd) |
| 275 | self._path = path |
| 276 | |
| 277 | @property |
| 278 | def path(self): |