SAMPLE
I|Is|Cat|so|is there|。|name|Is|yet|Nothing|I|。
REFERENCE
Shortcut morphological analysis by regular expression
PYTHON Subtly modified.
text_m = []
text = "I am a cat. There is no name yet."
p = re.compile(r"/|[A-Z]+|[a-z]+|[A-Hmm]+|[Ah-Hmm-]+|[A-Month]+|[one-Dragon]+|[。、]|/")
m = p.findall(text)
for row in m:
if re.compile(r'^[Ah-Hmm]+$').fullmatch(row):
if row[0] in 'Peeling':
prefix = row[0]
token = row[1:]
text_m.append(prefix)
if (len(token)>0):
text_m.append(token)
elif row[-2:] in 'So from':
token = row[0:-2]
suffix = row[-2:]
text_m.append(token)
text_m.append(suffix)
elif row[-1:] in 'Mohagade':
token = row[0:-1]
suffix = row[-1:]
text_m.append(token)
text_m.append(suffix)
else:
text_m.append(row)
else:
text_m.append(row)
## output
'|'.join(text_m)