diff options
Diffstat (limited to 'morphlib/morphloader.py')
-rw-r--r-- | morphlib/morphloader.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/morphlib/morphloader.py b/morphlib/morphloader.py index 8289b01e..e0f0952b 100644 --- a/morphlib/morphloader.py +++ b/morphlib/morphloader.py @@ -1,4 +1,4 @@ -# Copyright (C) 2013-2014 Codethink Limited +# Copyright (C) 2013-2015 Codethink Limited # # 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 @@ -398,13 +398,17 @@ class MorphologyLoader(object): return morphlib.morphology.Morphology(obj) - def load_from_string(self, string, filename='string'): + def load_from_string(self, string, + filename='string'): # pragma: no cover '''Load a morphology from a string. Return the Morphology object. ''' + if string is None: + return None + m = self.parse_morphology_text(string, filename) m.filename = filename self.validate(m) |