Syllabify the given word, whether simplex or complex.
558593
def syllabify(word):
    ''''''
    compound = bool(re.search(r'(-| |=)', word))
    syllabify = _syllabify_compound if compound else _syllabify_simplex
    syllabifications = list(syllabify(word))

    for word, rules in rank(syllabifications):
        # post-process
        word = str(replace_umlauts(word, put_back=True))
        rules = rules[1:]

        yield word, rules
632162
def apply_T6(word):
    ''''''
    WORD = _split_consonants_and_vowels(word)

    for k, v in WORD.iteritems():

        if len(v) == 3 and is_vowel(v[0]):
            vv = [v.find(i) for i in LONG_VOWELS if v.find(i) > 0]

            if any(vv):
                vv = vv[0]

                if vv == v[0]:
                    WORD[k] = v[:2] + '.' + v[2:]

                else:
                    WORD[k] = v[:vv] + '.' + v[vv:]

    word = _compile_dict_into_word(WORD)

    return word
935181
def targetword(self, index, targetwords, alignment):
        """"""
        if alignment[index]:
            return targetwords[alignment[index]]
        else:
            return None
404317
def apply(self, word, ctx=None):
        
        return Sequential.in_sequence(word,AdjacentVowels.uyir_letters,AdjacentVowels.reason)
349259
def add(self, word):
        """"""
        if not word or word.strip() == '':
            return
        self.words[word]=word
617802
protected int simpleSyllablesCount(String word) {
    if(word.length() == 0) {
      return 0;
    }
    if(word.length() == 1) {
      return 1;
    }
    int nSyllables = 0;
    boolean lastDouble = false;
    for (int i = 0; i < word.length() - 1; i++) {
      char c = word.charAt(i);
      if(isVowel(c)) {
        char cn = word.charAt(i + 1);
        if(lastDouble) {
          nSyllables++;
          lastDouble = false;
        } else if(((c == 'e' || c == 'E') && (cn == 'a' || cn == 'o' || cn == 'e' || cn == 'i' || cn == 'y')) || 
            ((c == 'a' || c == 'A') && (cn == 'e' || cn == 'i' || cn == 'u')) ||
            ((c == 'o' || c == 'O') && (cn == 'o' || cn == 'i' || cn == 'u' || cn == 'a')) ||
            ((c == 'u' || c == 'U') && (cn == 'i' || cn == 'a')) ||
            ((c == 'i' || c == 'I') && (cn == 'e'|| cn == 'o'))) {
          lastDouble = true;
        } else {
          nSyllables++;
          lastDouble = false;
        }
      } else {
        lastDouble = false;
      }
    }
    char c = word.charAt(word.length() - 1);
    char cl = word.charAt(word.length() - 2);
    if (cl == 'e' && (c == 's' || c == 'd') || cl == 'u' && c == 'e') {
        nSyllables--;
    } else if (isVowel(c) && c != 'e') {
        nSyllables++;
    }
    return nSyllables <= 0 ? 1 : nSyllables;
  }
319105
def iexpand(string, keep_escapes=False):
    """"""

    if isinstance(string, bytes):
        is_bytes = True
        string = string.decode('latin-1')

    else:
        is_bytes = False

    if is_bytes:
        return (entry.encode('latin-1') for entry in ExpandBrace(keep_escapes).expand(string))

    else:
        return (entry for entry in ExpandBrace(keep_escapes).expand(string))
775163
function properize(word, options) {
  options = _.extend({inflect: false}, options);
  if (!/\./.test(word)) {
    word = changeCase(word);
    if (options.inflect === false) {
      return word;
    }
    return inflection.singularize(word);
  }
  return word;
}
654788
def syllabify_ipa(self, word):
        
        word = word[1:-1]
        word = ''.join(l for l in unicodedata.normalize('NFD', word) if unicodedata.category(l) != 'Mn')

        return self.syllabify_ssp(word)
508918
private static int wordsWithThreeSyllables(String strText) {
        int intLongWordCount = 0;
        
        List<String> arrWords = (new WhitespaceTokenizer()).tokenize(strText);
        int intWordCount = arrWords.size();
        for (int i = 0; i < intWordCount; ++i) {
            if(syllableCount(arrWords.get(i)) > 2) {
                ++intLongWordCount; //it also counts the proper nouns which should be excluded for Fog index, but this is not a major issue
            }
        }
        
        return intLongWordCount;
    }
257816
def preprocess(ops, nlp, rows, get_ids):
    """"""
    Xs = []
    ys = []
    for (text1, text2), label in rows:
        Xs.append((get_ids([nlp(text1)])[0], get_ids([nlp(text2)])[0]))
        ys.append(label)
    return Xs, to_categorical(ys, nb_classes=2)
184216
def syllabify(word, compound=None):
    ''''''
    if compound is None:
        compound = bool(re.search(r'(-| |=)', word))

    syllabify = _syllabify_compound if compound else _syllabify
    syll, rules = syllabify(word)

    yield syll, rules

    n = 7

    if 'T4' in rules:
        yield syllabify(word, T4=False)
        n -= 1

    if 'e' in rules:
        yield syllabify(word, T1E=False)
        n -= 1

    if 'e' in rules and 'T4' in rules:
        yield syllabify(word, T4=False, T1E=False)
        n -= 1

    # yield empty syllabifications and rules
    for i in range(n):
        yield '', ''
1078066
def stress(syllabified_simplex_word):
    ''''''
    syllables = syllabified_simplex_word.split('.')
    stressed = '\'' + syllables[0]  # primary stress

    try:
        n = 0
        medial = syllables[1:-1]

        for i, syll in enumerate(medial):

            if (i + n) % 2 == 0:
                stressed += '.' + syll

            else:
                try:
                    if is_light(syll) and is_heavy(medial[i + 1]):
                        stressed += '.' + syll
                        n += 1
                        continue

                except IndexError:
                    pass

                # secondary stress
                stressed += '.`' + syll

    except IndexError:
        pass

    if len(syllables) > 1:
        stressed += '.' + syllables[-1]

    return stressed
1110306
def compile(self, X, verbose=False):
        
        for term in self._terms:
            term.compile(X, verbose=False)

        if self.by is not None and self.by >= X.shape[1]:
            raise ValueError('by variable requires feature {}, '\
                             'but X has only {} dimensions'\
                             .format(self.by, X.shape[1]))
        return self
239512
def apply_T7(word):
    ''''''
    WORD = _split_consonants_and_vowels(word)

    for k, v in WORD.iteritems():

        if len(v) == 3 and is_vowel(v[0]):
            WORD[k] = v[:2] + '.' + v[2:]

    word = _compile_dict_into_word(WORD)

    return word
445738
private void addWord(String word, boolean containsNewLine) {
        currentSentence.add(word);
        if (containsNewLine) {
            sentences.add(getSentenceFromListCheckingNewLines(currentSentence));
            currentSentence.clear();
        }
    }
1293121
def _doublec(self, word):
        """"""
        if len(word) < 2:
            return False
        if (word[-1] != word[-2]):
            return False
        return self._cons(word, len(word)-1)