Commit c2cd5625 by Sartika Aritonang

Upload New File

parent 6a037190
import re
class DisambiguatorPrefixRule29(object):
"""Disambiguate Prefix Rule 29
Original Rule 29 : peng{g|h|q} -> peng-{g|h|q}
Modified Rule 29 by ECS : pengC -> peng-C
"""
def disambiguate(self, word):
"""Disambiguate Prefix Rule 29
Original Rule 29 : peng{g|h|q} -> peng-{g|h|q}
Modified Rule 29 by ECS : pengC -> peng-C
"""
matches = re.match(r'^peng([bcdfghjklmnpqrstvwxyz])(.*)$', word)
if matches:
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