diff --git a/wsd/models/__init__.py b/wsd/models/__init__.py index 24dde75..475e0df 100644 --- a/wsd/models/__init__.py +++ b/wsd/models/__init__.py @@ -1 +1,2 @@ -from .baseline import JMDict \ No newline at end of file +"""A collection of WSD models.""" +from .baseline import JMDict diff --git a/wsd/models/baseline.py b/wsd/models/baseline.py index 77fe77e..712f1d8 100644 --- a/wsd/models/baseline.py +++ b/wsd/models/baseline.py @@ -1,3 +1,4 @@ +"""A simple dictionary interface for JMDict.""" from wsd.parsers import JMDictParser @@ -12,7 +13,7 @@ def search(self, text): Currently returns all entries that contain the text in either the kanji or reading. - + Parameters ---------- text : str @@ -27,13 +28,13 @@ def search(self, text): if r_ele.reb == text: res.append(entry) return res - + def feeling_lucky(self, text): """Return the first entry found. Currently returns the first entry that contains the text in either the kanji or reading. - + Parameters ---------- text : str @@ -43,4 +44,4 @@ def feeling_lucky(self, text): return entries[0] if entries else None -__all__ = ['JMdict'] +__all__ = ['JMDict']