MCPcopy Index your code
hub / github.com/clips/pattern / upper_consonant_y

Function upper_consonant_y

pattern/vector/stemmer.py:296–308  ·  view source on GitHub ↗

Sets the initial y, or y after a vowel, to Y. Of course, y is interpreted as a vowel and Y as a consonant.

(w)

Source from the content-addressed store, hash-verified

294 return "".join(ch)
295
296def upper_consonant_y(w):
297 """ Sets the initial y, or y after a vowel, to Y.
298 Of course, y is interpreted as a vowel and Y as a consonant.
299 """
300 a = []
301 p = None
302 for ch in w:
303 if ch == "y" and (p is None or p in VOWELS):
304 a.append("Y")
305 else:
306 a.append(ch)
307 p = ch
308 return "".join(a)
309
310# If we stemmed a word once, we can cache the result and reuse it.
311# By default, keep a history of a 10000 entries (<500KB).

Callers 1

stemFunction · 0.85

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…