# Path: cptm/utils/inputgeneration.py
# def remove_trailing_digits(word):
#     """Convert words like d66 to d.
# 
#     In the folia files from politicalmashup, words such as d66 have been
#     extracted as two words (d and 66) and only d ended up in the data input
#     files. The folia files were probably created with an old version of frog,
#     because currenly, words like these are parsed correctly.
# 
#     This function can be used when parsing and lemmatizing new text to match
#     the vocabulary used in the old folia files.
#     """
#     regex = re.compile('^(.+?)(\d+)$', flags=re.UNICODE)
#     m = regex.match(word)
#     if m:
#         return m.group(1)
#     return word


from nose.tools import assert_equal
from cptm.utils.inputgeneration import remove_trailing_digits
#!/usr/bin/python
# -*- coding: utf-8 -*-



def test_remove_training_digits():
    cases = {u'd66': u'd',
             u'f16': u'f',
             u'é33': u'é'}

    for i, o in cases.iteritems():

# Path: cptm/utils/inputgeneration.py
# def remove_trailing_digits(word):
#     """Convert words like d66 to d.
# 
#     In the folia files from politicalmashup, words such as d66 have been
#     extracted as two words (d and 66) and only d ended up in the data input
#     files. The folia files were probably created with an old version of frog,
#     because currenly, words like these are parsed correctly.
# 
#     This function can be used when parsing and lemmatizing new text to match
#     the vocabulary used in the old folia files.
#     """
#     regex = re.compile('^(.+?)(\d+)$', flags=re.UNICODE)
#     m = regex.match(word)
#     if m:
#         return m.group(1)
#     return word


# Path: cptm/tests/test_inputgeneration.py
from nose.tools import assert_equal
from cptm.utils.inputgeneration import remove_trailing_digits

#!/usr/bin/python
# -*- coding: utf-8 -*-



def test_remove_training_digits():
    cases = {u'd66': u'd',
             u'f16': u'f',
             u'é33': u'é'}

    for i, o in cases.iteritems():

        r = remove_trailing_digits(i)