diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2020-05-13 14:43:32 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2020-05-13 14:43:32 +0200 |
| commit | 4014fe1faca0ac38c0e40962bc14dd1124780a38 (patch) | |
| tree | c1c1e81e65cd11020c4393b9e6ddbe41a73bccec /cli/app/utils/word_utils.py | |
| parent | 3e837b0b2c2607e699a2997578a580f1c3e605b2 (diff) | |
add finneganizer
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 |
