From 4014fe1faca0ac38c0e40962bc14dd1124780a38 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 13 May 2020 14:43:32 +0200 Subject: add finneganizer --- cli/app/utils/word_utils.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 cli/app/utils/word_utils.py (limited to 'cli/app/utils/word_utils.py') 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 -- cgit v1.2.3-70-g09d2