diff options
author | Richard Maw <richard.maw@codethink.co.uk> | 2015-06-02 13:35:26 +0000 |
---|---|---|
committer | Richard Maw <richard.maw@codethink.co.uk> | 2015-06-12 08:53:34 +0000 |
commit | de977c00b90885a66a9aa089ef70519a2c0ce432 (patch) | |
tree | b08dd1a1f4d8e6129b87ba288728d46333ccc093 | |
parent | 15da1e3cd2819b8954e5a72849b039b87623a8b1 (diff) | |
download | morph-de977c00b90885a66a9aa089ef70519a2c0ce432.tar.gz |
morphloader: When given definitions v5, include strip commands
Change-Id: Ib64e4f823de129a3a5a78eb1db6a4e0f6da03928
-rw-r--r-- | morphlib/morphloader.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/morphlib/morphloader.py b/morphlib/morphloader.py index b5e27f70..24c13d2e 100644 --- a/morphlib/morphloader.py +++ b/morphlib/morphloader.py @@ -16,6 +16,7 @@ import collections +import copy import logging import warnings import yaml @@ -377,6 +378,14 @@ class MorphologyLoader(object): }, } + def __init__(self, definitions_version=0): + if definitions_version >= 5: # pragma: no cover + self._static_defaults = copy.deepcopy(self._static_defaults) + self._static_defaults['chunk'].update({ + 'pre-strip-commands': None, + 'strip-commands': None, + 'post-strip-commands': None}) + def parse_morphology_text(self, text, morph_filename): '''Parse a textual morphology. |