Skip to content

Commit 1447b29

Browse files
committed
Quick fix for errors in camel_morphology.
1 parent e390b67 commit 1447b29

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

camel_tools/cli/camel_morphology.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
_ANALYSIS_BACKOFFS = frozenset(('NONE', 'NOAN_ALL', 'NOAN_PROP', 'ADD_ALL',
9292
'ADD_PROP'))
9393
_GENARATION_BACKOFFS = frozenset(('NONE', 'REINFLECT'))
94-
_BUILTIN_DBS = frozenset(MorphologyDB.list_builtin_dbs())
94+
_BUILTIN_DBS = frozenset([d.name for d in MorphologyDB.list_builtin_dbs()])
9595
_DEFAULT_DB = 'calima-msa-r13'
9696

9797
_DIAC_RE = re.compile(r'[' + re.escape(u''.join(AR_DIAC_CHARSET)) + r']')
@@ -143,8 +143,10 @@ def _open_files(finpath, foutpath):
143143

144144

145145
def _list_dbs():
146-
for db in sorted(MorphologyDB.list_builtin_dbs()):
147-
sys.stdout.write('{}\t{}\n'.format(db.name, db.version))
146+
for db in sorted(MorphologyDB.list_builtin_dbs(), key=lambda d: d.name):
147+
# TODO: Print versions and descriptions when they are added to catalogue.
148+
# sys.stdout.write('{}\t{}\n'.format(db.name, db.version))
149+
sys.stdout.write('{}\n'.format(db.name))
148150

149151

150152
def _serialize_analyses(fout, word, analyses, order, generation=False):

camel_tools/morphology/database.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838
from camel_tools.data import CATALOGUE
3939

4040

41-
MorphologyDBFlags = namedtuple('MorphologyDBFlags', ['analysis', 'generation',
41+
MorphologyDBFlags = namedtuple('MorphologyDBFlags', ['analysis',
42+
'generation',
4243
'reinflection'])
4344

4445

0 commit comments

Comments
 (0)