Exemplo n.º 1
0
def expand_match(contraction):
    match = contraction.group(0)
    first_char = match[0]
    expanded_contraction = contractions_dict.get(match) \
        if contractions_dict.get(match) \
        else contractions_dict.get(match.lower())
    expanded_contraction = expanded_contraction
    return expanded_contraction
Exemplo n.º 2
0
def expand_match(contraction):
    match = contraction.group(0)
    first_char = match[0]
    expanded_contraction = (contractions_dict.get(match)
                            if contractions_dict.get(match) else
                            contractions_dict.get(match.lower()))
    if not expanded_contraction:
        return ""
    return first_char + expanded_contraction[1:]
 def expand_match(contraction):
     """get the matching form of the contractions available"""
     match = contraction.group(0)
     # make the selection for expanded form
     expanded_contraction = contractions_dict.get(match) \
         if contractions_dict.get(match) \
         else contractions_dict.get(match.lower())
     # assign the expanded form into expanded_contraction
     return expanded_contraction