Commit d28a95ec by Sartika Aritonang

Upload New File

parent 66debd2e
import re
class DisambiguatorPrefixRule34(object):
"""Disambiguate Prefix Rule 34
Rule 34 : peCP -> pe-CP where C != {r|w|y|l|m|n} and P != 'er'
"""
def disambiguate(self, word):
"""Disambiguate Prefix Rule 34
Rule 34 : peCP -> pe-CP where C != {r|w|y|l|m|n} and P != 'er'
"""
matches = re.match(r'^pe([bcdfghjklmnpqrstvwxyz])(.*)$', word)
if matches:
if re.match(r'^er(.*)$', matches.group(2)):
return
return matches.group(1) + matches.group(2)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment