diff options
Diffstat (limited to 'cli/app/utils/word_utils.py')
| -rw-r--r-- | cli/app/utils/word_utils.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/cli/app/utils/word_utils.py b/cli/app/utils/word_utils.py new file mode 100644 index 0000000..cbbcb85 --- /dev/null +++ b/cli/app/utils/word_utils.py @@ -0,0 +1,22 @@ +def is_oe(years): + return (('oe' in years and 'oe-' not in years) or 'arch' in years) + +def is_slang(years): + return 'slang' in years or 'colloq' in years + +def is_scots(years): + return 'Scots' in years + +def fix_word(word): + if '<' in word or '/' in word or ',' in word: + word = word.split("<")[0] + word = word.split(",")[0] + word = word.split("/")[0] + return word.strip() + +def is_compound_word(word): + if '-' in word: + return True + if ' ' in word: + return True + return False |
