# Path: newsApp/encodedEntity.py
# class EncodedEntity:
#   """
#   Represents a phonetically encoded entity
#   """
# 
#   def __init__(self, plainEntity):
#     """
#     Instantiates a new encoded entity object.
#     Requires 'plainEntity': plain text entity to encode
#     """
# 
#     self.plain = plainEntity
#     self.encoded = jellyfish.metaphone(plainEntity)
# 
# Path: newsApp/textHelper.py
# def removeNonAsciiChars(text):
#     return unicodedata.normalize('NFKD', text).encode('ascii','ignore').decode()


import itertools
import logging
import string
import math
import nltk
from retrying import retry
from .encodedEntity import EncodedEntity
from .textHelper import removeNonAsciiChars

def getDigitForToken(token):
    digitsDict = {
        'one': '1',
        'two': '2',
        'three': '3',
        'four': '4',
        'five': '5',
        'six': '6',
        'seven': '7',
        'eight': '8',
        'nine': '9',
        'ten': '10',
        'eleven': '11',
        'twelve': '12',
        'thirteen': '13',
        'fourteen': '14',
        'fifteen': '15',
        'sixteen': '16',
        'seventeen': '17',
        'eighteen': '18',
        'nineteen': '19'
    }

    return digitsDict.get(token, token)

def replaceWordTokensWithDigits(tokens):
    return [getDigitForToken(token) for token in tokens]

def getTokens(text):

# Path: newsApp/encodedEntity.py
# class EncodedEntity:
#   """
#   Represents a phonetically encoded entity
#   """
# 
#   def __init__(self, plainEntity):
#     """
#     Instantiates a new encoded entity object.
#     Requires 'plainEntity': plain text entity to encode
#     """
# 
#     self.plain = plainEntity
#     self.encoded = jellyfish.metaphone(plainEntity)
# 
# Path: newsApp/textHelper.py
# def removeNonAsciiChars(text):
#     return unicodedata.normalize('NFKD', text).encode('ascii','ignore').decode()


# Path: newsApp/textHelperNltk.py
import itertools
import logging
import string
import math
import nltk
from retrying import retry
from .encodedEntity import EncodedEntity
from .textHelper import removeNonAsciiChars


def getDigitForToken(token):
    digitsDict = {
        'one': '1',
        'two': '2',
        'three': '3',
        'four': '4',
        'five': '5',
        'six': '6',
        'seven': '7',
        'eight': '8',
        'nine': '9',
        'ten': '10',
        'eleven': '11',
        'twelve': '12',
        'thirteen': '13',
        'fourteen': '14',
        'fifteen': '15',
        'sixteen': '16',
        'seventeen': '17',
        'eighteen': '18',
        'nineteen': '19'
    }

    return digitsDict.get(token, token)

def replaceWordTokensWithDigits(tokens):
    return [getDigitForToken(token) for token in tokens]

def getTokens(text):

    text = removeNonAsciiChars(text)