From b7f9cbdc834fdde3f7c2ebf93698d3918faa8929 Mon Sep 17 00:00:00 2001 From: Ines Montani Date: Sat, 9 Mar 2019 01:35:36 +0100 Subject: [PATCH] Fix undefined names --- spacy/lang/ga/irish_morphology_helpers.py | 48 +++++++++++------------ 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/spacy/lang/ga/irish_morphology_helpers.py b/spacy/lang/ga/irish_morphology_helpers.py index 383e24efc..0221829b3 100644 --- a/spacy/lang/ga/irish_morphology_helpers.py +++ b/spacy/lang/ga/irish_morphology_helpers.py @@ -1,33 +1,31 @@ # coding: utf8 from __future__ import unicode_literals -class IrishMorph: - consonants = ['b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'q', 'r', 's', 't', 'v', 'w', 'x', 'z'] - broad_vowels = ['a', 'á', 'o', 'ó', 'u', 'ú'] - slender_vowels = ['e', 'é', 'i', 'í'] - vowels = broad_vowels + slender_vowels +consonants = ['b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'q', 'r', 's', 't', 'v', 'w', 'x', 'z'] +broad_vowels = ['a', 'á', 'o', 'ó', 'u', 'ú'] +slender_vowels = ['e', 'é', 'i', 'í'] +vowels = broad_vowels + slender_vowels - def ends_dentals(word): - if word != "" and word[-1] in ['d', 'n', 't', 's']: - return True - else: - return False +def ends_dentals(word): + if word != "" and word[-1] in ['d', 'n', 't', 's']: + return True + else: + return False - def devoice(word): - if len(word) > 2 and word[-2] == 's' and word[-1] == 'd': - return word[:-1] + 't' - else: - return word +def devoice(word): + if len(word) > 2 and word[-2] == 's' and word[-1] == 'd': + return word[:-1] + 't' + else: + return word - def ends_with_vowel(word): - return word != "" and word[-1] in vowels +def ends_with_vowel(word): + return word != "" and word[-1] in vowels - def starts_with_vowel(word): - return word != "" and word[0] in vowels - - def deduplicate(word): - if len(word) > 2 and word[-2] == word[-1] and word[-1] in consonants: - return word[:-1] - else: - return word +def starts_with_vowel(word): + return word != "" and word[0] in vowels +def deduplicate(word): + if len(word) > 2 and word[-2] == word[-1] and word[-1] in consonants: + return word[:-1] + else: + return word