2016-09-25 12:49:00 +00:00
|
|
|
# encoding: utf8
|
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
2016-12-07 19:29:52 +00:00
|
|
|
from ..symbols import *
|
2016-12-17 11:32:48 +00:00
|
|
|
from ..language_data import PRON_LEMMA
|
2016-09-25 12:49:00 +00:00
|
|
|
|
|
|
|
|
2017-01-03 17:26:09 +00:00
|
|
|
EXC = {}
|
|
|
|
|
2017-01-05 18:57:00 +00:00
|
|
|
EXCLUDE_EXC = ["Ill", "ill", "Its", "its", "Hell", "hell", "Well", "well", "Whore", "whore"]
|
2017-01-03 17:26:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
# Pronouns
|
|
|
|
|
|
|
|
for pron in ["i"]:
|
|
|
|
for orth in [pron, pron.title()]:
|
|
|
|
EXC[orth + "'m"] = [
|
|
|
|
{ORTH: orth, LEMMA: PRON_LEMMA, TAG: "PRP"},
|
|
|
|
{ORTH: "'m", LEMMA: "be", TAG: "VBP", "tenspect": 1, "number": 1}
|
|
|
|
]
|
|
|
|
|
2017-01-03 17:27:43 +00:00
|
|
|
EXC[orth + "m"] = [
|
2017-01-03 17:26:09 +00:00
|
|
|
{ORTH: pron, LEMMA: PRON_LEMMA, TAG: "PRP"},
|
|
|
|
{ORTH: "m", LEMMA: "be", TAG: "VBP", "tenspect": 1, "number": 1 }
|
|
|
|
]
|
|
|
|
|
2017-01-03 17:27:43 +00:00
|
|
|
EXC[orth + "'ma"] = [
|
2017-01-03 17:26:09 +00:00
|
|
|
{ORTH: pron, LEMMA: PRON_LEMMA, TAG: "PRP"},
|
|
|
|
{ORTH: "'m", LEMMA: "be", NORM: "am"},
|
|
|
|
{ORTH: "a", LEMMA: "going to", NORM: "gonna"}
|
|
|
|
]
|
|
|
|
|
2017-01-03 17:27:43 +00:00
|
|
|
EXC[orth + "ma"] = [
|
2017-01-03 17:26:09 +00:00
|
|
|
{ORTH: pron, LEMMA: PRON_LEMMA, TAG: "PRP"},
|
|
|
|
{ORTH: "m", LEMMA: "be", NORM: "am"},
|
|
|
|
{ORTH: "a", LEMMA: "going to", NORM: "gonna"}
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
for pron in ["i", "you", "he", "she", "it", "we", "they"]:
|
|
|
|
for orth in [pron, pron.title()]:
|
|
|
|
EXC[orth + "'ll"] = [
|
|
|
|
{ORTH: orth, LEMMA: PRON_LEMMA, TAG: "PRP"},
|
|
|
|
{ORTH: "'ll", LEMMA: "will", TAG: "MD"}
|
|
|
|
]
|
|
|
|
|
|
|
|
EXC[orth + "ll"] = [
|
|
|
|
{ORTH: orth, LEMMA: PRON_LEMMA, TAG: "PRP"},
|
|
|
|
{ORTH: "ll", LEMMA: "will", TAG: "MD"}
|
|
|
|
]
|
|
|
|
|
|
|
|
EXC[orth + "'ll've"] = [
|
|
|
|
{ORTH: orth, LEMMA: PRON_LEMMA, TAG: "PRP"},
|
|
|
|
{ORTH: "'ll", LEMMA: "will", TAG: "MD"},
|
|
|
|
{ORTH: "'ve", LEMMA: "have", TAG: "VB"}
|
|
|
|
]
|
|
|
|
|
|
|
|
EXC[orth + "llve"] = [
|
|
|
|
{ORTH: orth, LEMMA: PRON_LEMMA, TAG: "PRP"},
|
|
|
|
{ORTH: "ll", LEMMA: "will", TAG: "MD"},
|
|
|
|
{ORTH: "ve", LEMMA: "have", TAG: "VB"}
|
|
|
|
]
|
|
|
|
|
|
|
|
EXC[orth + "'d"] = [
|
|
|
|
{ORTH: orth, LEMMA: PRON_LEMMA, TAG: "PRP"},
|
|
|
|
{ORTH: "'d", LEMMA: "would", TAG: "MD"}
|
|
|
|
]
|
|
|
|
|
|
|
|
EXC[orth + "d"] = [
|
|
|
|
{ORTH: orth, LEMMA: PRON_LEMMA, TAG: "PRP"},
|
|
|
|
{ORTH: "d", LEMMA: "would", TAG: "MD"}
|
|
|
|
]
|
|
|
|
|
|
|
|
EXC[orth + "'d've"] = [
|
|
|
|
{ORTH: orth, LEMMA: PRON_LEMMA, TAG: "PRP"},
|
|
|
|
{ORTH: "'d", LEMMA: "would", TAG: "MD"},
|
|
|
|
{ORTH: "'ve", LEMMA: "have", TAG: "VB"}
|
|
|
|
]
|
|
|
|
|
|
|
|
EXC[orth + "dve"] = [
|
|
|
|
{ORTH: orth, LEMMA: PRON_LEMMA, TAG: "PRP"},
|
|
|
|
{ORTH: "d", LEMMA: "would", TAG: "MD"},
|
|
|
|
{ORTH: "ve", LEMMA: "have", TAG: "VB"}
|
|
|
|
]
|
|
|
|
|
|
|
|
|
2017-01-05 18:57:00 +00:00
|
|
|
for pron in ["i", "you", "we", "they"]:
|
|
|
|
for orth in [pron, pron.title()]:
|
|
|
|
EXC[orth + "'ve"] = [
|
|
|
|
{ORTH: orth, LEMMA: PRON_LEMMA, TAG: "PRP"},
|
|
|
|
{ORTH: "'ve", LEMMA: "have", TAG: "VB"}
|
|
|
|
]
|
|
|
|
|
|
|
|
EXC[orth + "ve"] = [
|
|
|
|
{ORTH: orth, LEMMA: PRON_LEMMA, TAG: "PRP"},
|
|
|
|
{ORTH: "ve", LEMMA: "have", TAG: "VB"}
|
|
|
|
]
|
|
|
|
|
|
|
|
|
2017-01-03 17:26:09 +00:00
|
|
|
for pron in ["you", "we", "they"]:
|
|
|
|
for orth in [pron, pron.title()]:
|
|
|
|
EXC[orth + "'re"] = [
|
|
|
|
{ORTH: orth, LEMMA: PRON_LEMMA, TAG: "PRP"},
|
|
|
|
{ORTH: "'re", LEMMA: "be", NORM: "are"}
|
|
|
|
]
|
|
|
|
|
|
|
|
EXC[orth + "re"] = [
|
|
|
|
{ORTH: orth, LEMMA: PRON_LEMMA, TAG: "PRP"},
|
|
|
|
{ORTH: "re", LEMMA: "be", NORM: "are"}
|
|
|
|
]
|
|
|
|
|
|
|
|
|
2017-01-05 18:57:00 +00:00
|
|
|
for pron in ["he", "she", "it"]:
|
|
|
|
for orth in [pron, pron.title()]:
|
|
|
|
EXC[orth + "'s"] = [
|
|
|
|
{ORTH: orth, LEMMA: PRON_LEMMA, TAG: "PRP"},
|
|
|
|
{ORTH: "'s"}
|
|
|
|
]
|
|
|
|
|
|
|
|
EXC[orth + "s"] = [
|
|
|
|
{ORTH: orth, LEMMA: PRON_LEMMA, TAG: "PRP"},
|
|
|
|
{ORTH: "s"}
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-03 17:26:09 +00:00
|
|
|
# W-words, relative pronouns, prepositions etc.
|
|
|
|
|
|
|
|
for word in ["who", "what", "when", "where", "why", "how", "there", "that"]:
|
|
|
|
for orth in [word, word.title()]:
|
|
|
|
EXC[orth + "'s"] = [
|
2017-01-03 22:01:31 +00:00
|
|
|
{ORTH: orth, LEMMA: word},
|
2017-01-03 17:26:09 +00:00
|
|
|
{ORTH: "'s"}
|
|
|
|
]
|
|
|
|
|
|
|
|
EXC[orth + "s"] = [
|
2017-01-03 22:01:31 +00:00
|
|
|
{ORTH: orth, LEMMA: word},
|
2017-01-03 17:26:09 +00:00
|
|
|
{ORTH: "s"}
|
|
|
|
]
|
|
|
|
|
|
|
|
EXC[orth + "'ll"] = [
|
2017-01-03 22:01:31 +00:00
|
|
|
{ORTH: orth, LEMMA: word},
|
2017-01-03 17:26:09 +00:00
|
|
|
{ORTH: "'ll", LEMMA: "will", TAG: "MD"}
|
|
|
|
]
|
|
|
|
|
|
|
|
EXC[orth + "ll"] = [
|
2017-01-03 22:01:31 +00:00
|
|
|
{ORTH: orth, LEMMA: word},
|
2017-01-03 17:26:09 +00:00
|
|
|
{ORTH: "ll", LEMMA: "will", TAG: "MD"}
|
|
|
|
]
|
|
|
|
|
|
|
|
EXC[orth + "'ll've"] = [
|
2017-01-03 22:01:31 +00:00
|
|
|
{ORTH: orth, LEMMA: word},
|
2017-01-03 17:26:09 +00:00
|
|
|
{ORTH: "ll", LEMMA: "will", TAG: "MD"},
|
|
|
|
{ORTH: "ve", LEMMA: "have", TAG: "VB"}
|
|
|
|
]
|
|
|
|
|
|
|
|
EXC[orth + "llve"] = [
|
2017-01-03 22:01:31 +00:00
|
|
|
{ORTH: orth, LEMMA: word},
|
2017-01-03 17:26:09 +00:00
|
|
|
{ORTH: "ll", LEMMA: "will", TAG: "MD"},
|
|
|
|
{ORTH: "ve", LEMMA: "have", TAG: "VB"}
|
|
|
|
]
|
|
|
|
|
|
|
|
EXC[orth + "'re"] = [
|
2017-01-03 22:01:31 +00:00
|
|
|
{ORTH: orth, LEMMA: word},
|
2017-01-03 17:26:09 +00:00
|
|
|
{ORTH: "'re", LEMMA: "be", NORM: "are"}
|
|
|
|
]
|
|
|
|
|
|
|
|
EXC[orth + "re"] = [
|
2017-01-03 22:01:31 +00:00
|
|
|
{ORTH: orth, LEMMA: word},
|
2017-01-03 17:26:09 +00:00
|
|
|
{ORTH: "re", LEMMA: "be", NORM: "are"}
|
|
|
|
]
|
|
|
|
|
|
|
|
EXC[orth + "'ve"] = [
|
|
|
|
{ORTH: orth},
|
|
|
|
{ORTH: "'ve", LEMMA: "have", TAG: "VB"}
|
|
|
|
]
|
|
|
|
|
|
|
|
EXC[orth + "ve"] = [
|
2017-01-03 22:01:31 +00:00
|
|
|
{ORTH: orth, LEMMA: word},
|
2017-01-03 17:26:09 +00:00
|
|
|
{ORTH: "'ve", LEMMA: "have", TAG: "VB"}
|
|
|
|
]
|
|
|
|
|
|
|
|
EXC[orth + "'d"] = [
|
2017-01-03 22:01:31 +00:00
|
|
|
{ORTH: orth, LEMMA: word},
|
2017-01-03 17:26:09 +00:00
|
|
|
{ORTH: "'d"}
|
|
|
|
]
|
|
|
|
|
|
|
|
EXC[orth + "d"] = [
|
2017-01-03 22:01:31 +00:00
|
|
|
{ORTH: orth, LEMMA: word},
|
2017-01-03 17:26:09 +00:00
|
|
|
{ORTH: "d"}
|
|
|
|
]
|
|
|
|
|
|
|
|
EXC[orth + "'d've"] = [
|
2017-01-03 22:01:31 +00:00
|
|
|
{ORTH: orth, LEMMA: word},
|
2017-01-03 17:26:09 +00:00
|
|
|
{ORTH: "'d", LEMMA: "would", TAG: "MD"},
|
|
|
|
{ORTH: "'ve", LEMMA: "have", TAG: "VB"}
|
|
|
|
]
|
|
|
|
|
|
|
|
EXC[orth + "dve"] = [
|
2017-01-03 22:01:31 +00:00
|
|
|
{ORTH: orth, LEMMA: word},
|
2017-01-03 17:26:09 +00:00
|
|
|
{ORTH: "d", LEMMA: "would", TAG: "MD"},
|
|
|
|
{ORTH: "ve", LEMMA: "have", TAG: "VB"}
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
# Verbs
|
|
|
|
|
|
|
|
for verb_data in [
|
|
|
|
{ORTH: "ca", LEMMA: "can", TAG: "MD"},
|
|
|
|
{ORTH: "could", TAG: "MD"},
|
|
|
|
{ORTH: "do", LEMMA: "do"},
|
|
|
|
{ORTH: "does", LEMMA: "do"},
|
|
|
|
{ORTH: "did", LEMMA: "do", TAG: "VBD"},
|
|
|
|
{ORTH: "had", LEMMA: "have", TAG: "VBD"},
|
|
|
|
{ORTH: "might"},
|
|
|
|
{ORTH: "must"},
|
|
|
|
{ORTH: "need"},
|
|
|
|
{ORTH: "sha", LEMMA: "shall"},
|
|
|
|
{ORTH: "should"},
|
|
|
|
{ORTH: "wo", LEMMA: "will"},
|
|
|
|
{ORTH: "would"}
|
|
|
|
]:
|
|
|
|
verb_data_tc = dict(verb_data)
|
|
|
|
verb_data_tc[ORTH] = verb_data_tc[ORTH].title()
|
|
|
|
|
|
|
|
for data in [verb_data, verb_data_tc]:
|
|
|
|
EXC[data[ORTH] + "n't"] = [
|
|
|
|
dict(data),
|
|
|
|
{ORTH: "n't", LEMMA: "not", TAG: "RB"}
|
|
|
|
]
|
|
|
|
|
|
|
|
EXC[data[ORTH] + "nt"] = [
|
|
|
|
dict(data),
|
|
|
|
{ORTH: "nt", LEMMA: "not", TAG: "RB"}
|
|
|
|
]
|
|
|
|
|
|
|
|
EXC[data[ORTH] + "n't've"] = [
|
|
|
|
{ORTH: "n't", LEMMA: "not", TAG: "RB"},
|
|
|
|
{ORTH: "'ve", LEMMA: "have", TAG: "VB"}
|
|
|
|
]
|
|
|
|
|
|
|
|
EXC[data[ORTH] + "ntve"] = [
|
|
|
|
{ORTH: "nt", LEMMA: "not", TAG: "RB"},
|
|
|
|
{ORTH: "ve", LEMMA: "have", TAG: "VB"}
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
for verb_data in [
|
|
|
|
{ORTH: "could", TAG: "MD"},
|
|
|
|
{ORTH: "might"},
|
|
|
|
{ORTH: "must"},
|
|
|
|
{ORTH: "should"}
|
|
|
|
]:
|
|
|
|
verb_data_tc = dict(verb_data)
|
|
|
|
verb_data_tc[ORTH] = verb_data_tc[ORTH].title()
|
|
|
|
|
|
|
|
for data in [verb_data, verb_data_tc]:
|
|
|
|
EXC[data[ORTH] + "'ve"] = [
|
|
|
|
dict(data),
|
|
|
|
{ORTH: "'ve", LEMMA: "have", TAG: "VB"}
|
|
|
|
]
|
|
|
|
|
|
|
|
EXC[data[ORTH] + "ve"] = [
|
|
|
|
dict(data),
|
|
|
|
{ORTH: "ve", LEMMA: "have", TAG: "VB"}
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
for verb_data in [
|
|
|
|
{ORTH: "ai", TAG: "VBP", "number": 2, LEMMA: "be"},
|
|
|
|
{ORTH: "are", LEMMA: "be", TAG: "VBP", "number": 2},
|
|
|
|
{ORTH: "is", LEMMA: "be", TAG: "VBZ"},
|
|
|
|
{ORTH: "was", LEMMA: "be"},
|
|
|
|
{ORTH: "were", LEMMA: "be"}
|
|
|
|
]:
|
|
|
|
verb_data_tc = dict(verb_data)
|
|
|
|
verb_data_tc[ORTH] = verb_data_tc[ORTH].title()
|
|
|
|
|
|
|
|
for data in [verb_data, verb_data_tc]:
|
|
|
|
EXC[data[ORTH] + "n't"] = [
|
|
|
|
dict(data),
|
|
|
|
{ORTH: "n't", LEMMA: "not", TAG: "RB"}
|
|
|
|
]
|
|
|
|
|
|
|
|
EXC[data[ORTH] + "nt"] = [
|
|
|
|
dict(data),
|
|
|
|
{ORTH: "nt", LEMMA: "not", TAG: "RB"}
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
# Abbreviations
|
|
|
|
|
|
|
|
ABBREVIATIONS = {
|
|
|
|
"Mt.": [
|
|
|
|
{ORTH: "Mt.", LEMMA: "Mount"}
|
2017-01-03 17:21:29 +00:00
|
|
|
],
|
|
|
|
|
2016-12-08 11:47:01 +00:00
|
|
|
"Ak.": [
|
|
|
|
{ORTH: "Ak.", LEMMA: "Alaska"}
|
|
|
|
],
|
|
|
|
|
|
|
|
"Ala.": [
|
|
|
|
{ORTH: "Ala.", LEMMA: "Alabama"}
|
|
|
|
],
|
|
|
|
|
|
|
|
"Apr.": [
|
|
|
|
{ORTH: "Apr.", LEMMA: "April"}
|
|
|
|
],
|
|
|
|
|
|
|
|
"Ariz.": [
|
|
|
|
{ORTH: "Ariz.", LEMMA: "Arizona"}
|
|
|
|
],
|
|
|
|
|
|
|
|
"Ark.": [
|
|
|
|
{ORTH: "Ark.", LEMMA: "Arkansas"}
|
|
|
|
],
|
|
|
|
|
|
|
|
"Aug.": [
|
|
|
|
{ORTH: "Aug.", LEMMA: "August"}
|
|
|
|
],
|
|
|
|
|
|
|
|
"Calif.": [
|
|
|
|
{ORTH: "Calif.", LEMMA: "California"}
|
|
|
|
],
|
|
|
|
|
|
|
|
"Colo.": [
|
|
|
|
{ORTH: "Colo.", LEMMA: "Colorado"}
|
|
|
|
],
|
|
|
|
|
|
|
|
"Conn.": [
|
|
|
|
{ORTH: "Conn.", LEMMA: "Connecticut"}
|
|
|
|
],
|
|
|
|
|
|
|
|
"Dec.": [
|
|
|
|
{ORTH: "Dec.", LEMMA: "December"}
|
|
|
|
],
|
|
|
|
|
|
|
|
"Del.": [
|
|
|
|
{ORTH: "Del.", LEMMA: "Delaware"}
|
|
|
|
],
|
|
|
|
|
|
|
|
"Feb.": [
|
|
|
|
{ORTH: "Feb.", LEMMA: "February"}
|
|
|
|
],
|
|
|
|
|
|
|
|
"Fla.": [
|
|
|
|
{ORTH: "Fla.", LEMMA: "Florida"}
|
|
|
|
],
|
|
|
|
|
|
|
|
"Ga.": [
|
|
|
|
{ORTH: "Ga.", LEMMA: "Georgia"}
|
|
|
|
],
|
|
|
|
|
|
|
|
"Ia.": [
|
|
|
|
{ORTH: "Ia.", LEMMA: "Iowa"}
|
|
|
|
],
|
|
|
|
|
|
|
|
"Id.": [
|
|
|
|
{ORTH: "Id.", LEMMA: "Idaho"}
|
|
|
|
],
|
|
|
|
|
|
|
|
"Ill.": [
|
|
|
|
{ORTH: "Ill.", LEMMA: "Illinois"}
|
|
|
|
],
|
|
|
|
|
|
|
|
"Ind.": [
|
|
|
|
{ORTH: "Ind.", LEMMA: "Indiana"}
|
|
|
|
],
|
|
|
|
|
|
|
|
"Jan.": [
|
|
|
|
{ORTH: "Jan.", LEMMA: "January"}
|
|
|
|
],
|
|
|
|
|
|
|
|
"Jul.": [
|
|
|
|
{ORTH: "Jul.", LEMMA: "July"}
|
|
|
|
],
|
|
|
|
|
|
|
|
"Jun.": [
|
|
|
|
{ORTH: "Jun.", LEMMA: "June"}
|
|
|
|
],
|
|
|
|
|
|
|
|
"Kan.": [
|
|
|
|
{ORTH: "Kan.", LEMMA: "Kansas"}
|
|
|
|
],
|
|
|
|
|
|
|
|
"Kans.": [
|
|
|
|
{ORTH: "Kans.", LEMMA: "Kansas"}
|
|
|
|
],
|
|
|
|
|
|
|
|
"Ky.": [
|
|
|
|
{ORTH: "Ky.", LEMMA: "Kentucky"}
|
|
|
|
],
|
|
|
|
|
|
|
|
"La.": [
|
|
|
|
{ORTH: "La.", LEMMA: "Louisiana"}
|
|
|
|
],
|
|
|
|
|
|
|
|
"Mar.": [
|
|
|
|
{ORTH: "Mar.", LEMMA: "March"}
|
|
|
|
],
|
|
|
|
|
|
|
|
"Mass.": [
|
|
|
|
{ORTH: "Mass.", LEMMA: "Massachusetts"}
|
|
|
|
],
|
|
|
|
|
|
|
|
"May.": [
|
|
|
|
{ORTH: "May.", LEMMA: "May"}
|
|
|
|
],
|
|
|
|
|
|
|
|
"Mich.": [
|
|
|
|
{ORTH: "Mich.", LEMMA: "Michigan"}
|
|
|
|
],
|
|
|
|
|
|
|
|
"Minn.": [
|
|
|
|
{ORTH: "Minn.", LEMMA: "Minnesota"}
|
|
|
|
],
|
|
|
|
|
|
|
|
"Miss.": [
|
|
|
|
{ORTH: "Miss.", LEMMA: "Mississippi"}
|
|
|
|
],
|
|
|
|
|
|
|
|
"N.C.": [
|
|
|
|
{ORTH: "N.C.", LEMMA: "North Carolina"}
|
|
|
|
],
|
|
|
|
|
|
|
|
"N.D.": [
|
|
|
|
{ORTH: "N.D.", LEMMA: "North Dakota"}
|
|
|
|
],
|
|
|
|
|
|
|
|
"N.H.": [
|
|
|
|
{ORTH: "N.H.", LEMMA: "New Hampshire"}
|
|
|
|
],
|
|
|
|
|
|
|
|
"N.J.": [
|
|
|
|
{ORTH: "N.J.", LEMMA: "New Jersey"}
|
|
|
|
],
|
|
|
|
|
|
|
|
"N.M.": [
|
|
|
|
{ORTH: "N.M.", LEMMA: "New Mexico"}
|
|
|
|
],
|
|
|
|
|
|
|
|
"N.Y.": [
|
|
|
|
{ORTH: "N.Y.", LEMMA: "New York"}
|
|
|
|
],
|
|
|
|
|
|
|
|
"Neb.": [
|
|
|
|
{ORTH: "Neb.", LEMMA: "Nebraska"}
|
|
|
|
],
|
|
|
|
|
|
|
|
"Nebr.": [
|
|
|
|
{ORTH: "Nebr.", LEMMA: "Nebraska"}
|
|
|
|
],
|
|
|
|
|
|
|
|
"Nev.": [
|
|
|
|
{ORTH: "Nev.", LEMMA: "Nevada"}
|
|
|
|
],
|
|
|
|
|
|
|
|
"Nov.": [
|
|
|
|
{ORTH: "Nov.", LEMMA: "November"}
|
|
|
|
],
|
|
|
|
|
|
|
|
"Oct.": [
|
|
|
|
{ORTH: "Oct.", LEMMA: "October"}
|
|
|
|
],
|
|
|
|
|
|
|
|
"Okla.": [
|
|
|
|
{ORTH: "Okla.", LEMMA: "Oklahoma"}
|
|
|
|
],
|
|
|
|
|
|
|
|
"Ore.": [
|
|
|
|
{ORTH: "Ore.", LEMMA: "Oregon"}
|
|
|
|
],
|
|
|
|
|
|
|
|
"Pa.": [
|
|
|
|
{ORTH: "Pa.", LEMMA: "Pennsylvania"}
|
|
|
|
],
|
|
|
|
|
|
|
|
"S.C.": [
|
|
|
|
{ORTH: "S.C.", LEMMA: "South Carolina"}
|
|
|
|
],
|
|
|
|
|
|
|
|
"Sep.": [
|
|
|
|
{ORTH: "Sep.", LEMMA: "September"}
|
|
|
|
],
|
|
|
|
|
|
|
|
"Sept.": [
|
|
|
|
{ORTH: "Sept.", LEMMA: "September"}
|
|
|
|
],
|
|
|
|
|
|
|
|
"Tenn.": [
|
|
|
|
{ORTH: "Tenn.", LEMMA: "Tennessee"}
|
|
|
|
],
|
|
|
|
|
|
|
|
"Va.": [
|
|
|
|
{ORTH: "Va.", LEMMA: "Virginia"}
|
|
|
|
],
|
|
|
|
|
|
|
|
"Wash.": [
|
|
|
|
{ORTH: "Wash.", LEMMA: "Washington"}
|
|
|
|
],
|
|
|
|
|
|
|
|
"Wis.": [
|
|
|
|
{ORTH: "Wis.", LEMMA: "Wisconsin"}
|
2016-12-17 13:00:52 +00:00
|
|
|
]
|
2016-09-25 12:49:00 +00:00
|
|
|
}
|
|
|
|
|
2016-12-07 19:29:52 +00:00
|
|
|
|
2017-01-03 17:26:09 +00:00
|
|
|
TOKENIZER_EXCEPTIONS = dict(EXC)
|
|
|
|
TOKENIZER_EXCEPTIONS.update(OTHER)
|
2017-01-05 18:58:07 +00:00
|
|
|
TOKENIZER_EXCEPTIONS.update(ABBREVIATIONS)
|
2017-01-03 17:26:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
# Remove EXCLUDE_EXC if in exceptions
|
|
|
|
|
|
|
|
for string in EXCLUDE_EXC:
|
|
|
|
if string in TOKENIZER_EXCEPTIONS:
|
|
|
|
TOKENIZER_EXCEPTIONS.pop(string)
|
|
|
|
|
|
|
|
|
|
|
|
# Abbreviations with only one ORTH token
|
|
|
|
|
2016-12-08 12:58:32 +00:00
|
|
|
ORTH_ONLY = [
|
2016-12-18 12:02:26 +00:00
|
|
|
"''",
|
2016-12-07 19:29:52 +00:00
|
|
|
"a.",
|
|
|
|
"a.m.",
|
|
|
|
"Adm.",
|
|
|
|
"b.",
|
|
|
|
"Bros.",
|
|
|
|
"c.",
|
|
|
|
"co.",
|
|
|
|
"Co.",
|
|
|
|
"Corp.",
|
|
|
|
"d.",
|
|
|
|
"D.C.",
|
|
|
|
"Dr.",
|
|
|
|
"e.",
|
|
|
|
"e.g.",
|
|
|
|
"E.g.",
|
|
|
|
"E.G.",
|
|
|
|
"f.",
|
|
|
|
"g.",
|
|
|
|
"Gen.",
|
|
|
|
"Gov.",
|
|
|
|
"h.",
|
|
|
|
"i.",
|
|
|
|
"i.e.",
|
|
|
|
"I.e.",
|
|
|
|
"I.E.",
|
|
|
|
"Inc.",
|
|
|
|
"j.",
|
|
|
|
"Jr.",
|
|
|
|
"k.",
|
|
|
|
"l.",
|
|
|
|
"Ltd.",
|
|
|
|
"m.",
|
|
|
|
"Md.",
|
|
|
|
"Messrs.",
|
|
|
|
"Mo.",
|
|
|
|
"Mont.",
|
|
|
|
"Mr.",
|
|
|
|
"Mrs.",
|
|
|
|
"Ms.",
|
|
|
|
"n.",
|
|
|
|
"o.",
|
|
|
|
"p.",
|
|
|
|
"p.m.",
|
|
|
|
"Ph.D.",
|
|
|
|
"q.",
|
|
|
|
"r.",
|
|
|
|
"Rep.",
|
|
|
|
"Rev.",
|
|
|
|
"s.",
|
|
|
|
"Sen.",
|
|
|
|
"St.",
|
|
|
|
"t.",
|
|
|
|
"u.",
|
|
|
|
"v.",
|
|
|
|
"vs.",
|
|
|
|
"w.",
|
|
|
|
"x.",
|
|
|
|
"y.",
|
2016-12-07 20:11:29 +00:00
|
|
|
"z."
|
2016-12-07 19:29:52 +00:00
|
|
|
]
|