2017-03-12 12:07:28 +00:00
|
|
|
# coding: utf8
|
2016-09-25 12:49:00 +00:00
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
2017-05-08 20:29:04 +00:00
|
|
|
from ...symbols import ORTH, LEMMA, TAG, NORM
|
|
|
|
from ...deprecated import PRON_LEMMA
|
2016-09-25 12:49:00 +00:00
|
|
|
|
|
|
|
|
2017-05-08 13:47:25 +00:00
|
|
|
_exc = {}
|
|
|
|
_exclude = ["Ill", "ill", "Its", "its", "Hell", "hell", "Shell", "shell",
|
2017-03-12 12:37:58 +00:00
|
|
|
"Shed", "shed", "were", "Were", "Well", "well", "Whore", "whore"]
|
2017-01-03 17:26:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
# Pronouns
|
|
|
|
|
|
|
|
for pron in ["i"]:
|
|
|
|
for orth in [pron, pron.title()]:
|
2017-05-08 13:47:25 +00:00
|
|
|
_exc[orth + "'m"] = [
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: orth, LEMMA: PRON_LEMMA, NORM: pron, TAG: "PRP"},
|
|
|
|
{ORTH: "'m", LEMMA: "be", NORM: "am", TAG: "VBP", "tenspect": 1, "number": 1}]
|
2017-01-03 17:26:09 +00:00
|
|
|
|
2017-05-08 13:47:25 +00:00
|
|
|
_exc[orth + "m"] = [
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: orth, LEMMA: PRON_LEMMA, NORM: pron, TAG: "PRP"},
|
2017-05-08 13:47:25 +00:00
|
|
|
{ORTH: "m", LEMMA: "be", TAG: "VBP", "tenspect": 1, "number": 1 }]
|
2017-01-03 17:26:09 +00:00
|
|
|
|
2017-05-08 13:47:25 +00:00
|
|
|
_exc[orth + "'ma"] = [
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: orth, LEMMA: PRON_LEMMA, NORM: pron, TAG: "PRP"},
|
2017-01-03 17:26:09 +00:00
|
|
|
{ORTH: "'m", LEMMA: "be", NORM: "am"},
|
2017-05-08 13:47:25 +00:00
|
|
|
{ORTH: "a", LEMMA: "going to", NORM: "gonna"}]
|
2017-01-03 17:26:09 +00:00
|
|
|
|
2017-05-08 13:47:25 +00:00
|
|
|
_exc[orth + "ma"] = [
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: orth, LEMMA: PRON_LEMMA, NORM: pron, TAG: "PRP"},
|
2017-01-03 17:26:09 +00:00
|
|
|
{ORTH: "m", LEMMA: "be", NORM: "am"},
|
2017-05-08 13:47:25 +00:00
|
|
|
{ORTH: "a", LEMMA: "going to", NORM: "gonna"}]
|
2017-01-03 17:26:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
for pron in ["i", "you", "he", "she", "it", "we", "they"]:
|
|
|
|
for orth in [pron, pron.title()]:
|
2017-05-08 13:47:25 +00:00
|
|
|
_exc[orth + "'ll"] = [
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: orth, LEMMA: PRON_LEMMA, NORM: pron, TAG: "PRP"},
|
|
|
|
{ORTH: "'ll", LEMMA: "will", NORM: "will", TAG: "MD"}]
|
2017-01-03 17:26:09 +00:00
|
|
|
|
2017-05-08 13:47:25 +00:00
|
|
|
_exc[orth + "ll"] = [
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: orth, LEMMA: PRON_LEMMA, NORM: pron, TAG: "PRP"},
|
|
|
|
{ORTH: "ll", LEMMA: "will", NORM: "will", TAG: "MD"}]
|
2017-01-03 17:26:09 +00:00
|
|
|
|
2017-05-08 13:47:25 +00:00
|
|
|
_exc[orth + "'ll've"] = [
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: orth, LEMMA: PRON_LEMMA, NORM: pron, TAG: "PRP"},
|
|
|
|
{ORTH: "'ll", LEMMA: "will", NORM: "will", TAG: "MD"},
|
|
|
|
{ORTH: "'ve", LEMMA: "have", NORM: "have", TAG: "VB"}]
|
2017-01-03 17:26:09 +00:00
|
|
|
|
2017-05-08 13:47:25 +00:00
|
|
|
_exc[orth + "llve"] = [
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: orth, LEMMA: PRON_LEMMA, NORM: pron, TAG: "PRP"},
|
|
|
|
{ORTH: "ll", LEMMA: "will", NORM: "will", TAG: "MD"},
|
|
|
|
{ORTH: "ve", LEMMA: "have", NORM: "have", TAG: "VB"}]
|
2017-01-03 17:26:09 +00:00
|
|
|
|
2017-05-08 13:47:25 +00:00
|
|
|
_exc[orth + "'d"] = [
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: orth, LEMMA: PRON_LEMMA, NORM: pron, TAG: "PRP"},
|
|
|
|
{ORTH: "'d", LEMMA: "would", NORM: "would", TAG: "MD"}]
|
2017-01-03 17:26:09 +00:00
|
|
|
|
2017-05-08 13:47:25 +00:00
|
|
|
_exc[orth + "d"] = [
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: orth, LEMMA: PRON_LEMMA, NORM: pron, TAG: "PRP"},
|
|
|
|
{ORTH: "d", LEMMA: "would", NORM: "would", TAG: "MD"}]
|
2017-01-03 17:26:09 +00:00
|
|
|
|
2017-05-08 13:47:25 +00:00
|
|
|
_exc[orth + "'d've"] = [
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: orth, LEMMA: PRON_LEMMA, NORM: pron, TAG: "PRP"},
|
|
|
|
{ORTH: "'d", LEMMA: "would", NORM: "would", TAG: "MD"},
|
|
|
|
{ORTH: "'ve", LEMMA: "have", NORM: "have", TAG: "VB"}]
|
2017-01-03 17:26:09 +00:00
|
|
|
|
2017-05-08 13:47:25 +00:00
|
|
|
_exc[orth + "dve"] = [
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: orth, LEMMA: PRON_LEMMA, NORM: pron, TAG: "PRP"},
|
|
|
|
{ORTH: "d", LEMMA: "would", NORM: "would", TAG: "MD"},
|
|
|
|
{ORTH: "ve", LEMMA: "have", NORM: "have", TAG: "VB"}]
|
2017-01-03 17:26:09 +00:00
|
|
|
|
|
|
|
|
2017-01-05 18:57:00 +00:00
|
|
|
for pron in ["i", "you", "we", "they"]:
|
|
|
|
for orth in [pron, pron.title()]:
|
2017-05-08 13:47:25 +00:00
|
|
|
_exc[orth + "'ve"] = [
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: orth, LEMMA: PRON_LEMMA, NORM: pron, TAG: "PRP"},
|
|
|
|
{ORTH: "'ve", LEMMA: "have", NORM: "have", TAG: "VB"}]
|
2017-01-05 18:57:00 +00:00
|
|
|
|
2017-05-08 13:47:25 +00:00
|
|
|
_exc[orth + "ve"] = [
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: orth, LEMMA: PRON_LEMMA, NORM: pron, TAG: "PRP"},
|
|
|
|
{ORTH: "ve", LEMMA: "have", NORM: "have", TAG: "VB"}]
|
2017-01-05 18:57:00 +00:00
|
|
|
|
|
|
|
|
2017-01-03 17:26:09 +00:00
|
|
|
for pron in ["you", "we", "they"]:
|
|
|
|
for orth in [pron, pron.title()]:
|
2017-05-08 13:47:25 +00:00
|
|
|
_exc[orth + "'re"] = [
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: orth, LEMMA: PRON_LEMMA, NORM: pron, TAG: "PRP"},
|
2017-05-08 13:47:25 +00:00
|
|
|
{ORTH: "'re", LEMMA: "be", NORM: "are"}]
|
2017-01-03 17:26:09 +00:00
|
|
|
|
2017-05-08 13:47:25 +00:00
|
|
|
_exc[orth + "re"] = [
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: orth, LEMMA: PRON_LEMMA, NORM: pron, TAG: "PRP"},
|
2017-05-08 13:47:25 +00:00
|
|
|
{ORTH: "re", LEMMA: "be", NORM: "are", TAG: "VBZ"}]
|
2017-01-03 17:26:09 +00:00
|
|
|
|
|
|
|
|
2017-01-05 18:57:00 +00:00
|
|
|
for pron in ["he", "she", "it"]:
|
|
|
|
for orth in [pron, pron.title()]:
|
2017-05-08 13:47:25 +00:00
|
|
|
_exc[orth + "'s"] = [
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: orth, LEMMA: PRON_LEMMA, NORM: pron, TAG: "PRP"},
|
|
|
|
{ORTH: "'s", NORM: "'s"}]
|
2017-01-05 18:57:00 +00:00
|
|
|
|
2017-05-08 13:47:25 +00:00
|
|
|
_exc[orth + "s"] = [
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: orth, LEMMA: PRON_LEMMA, NORM: pron, TAG: "PRP"},
|
2017-05-08 13:47:25 +00:00
|
|
|
{ORTH: "s"}]
|
2017-01-05 18:57:00 +00:00
|
|
|
|
|
|
|
|
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()]:
|
2017-05-08 13:47:25 +00:00
|
|
|
_exc[orth + "'s"] = [
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: orth, LEMMA: word, NORM: word},
|
|
|
|
{ORTH: "'s", NORM: "'s"}]
|
2017-01-03 17:26:09 +00:00
|
|
|
|
2017-05-08 13:47:25 +00:00
|
|
|
_exc[orth + "s"] = [
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: orth, LEMMA: word, NORM: word},
|
2017-05-08 13:47:25 +00:00
|
|
|
{ORTH: "s"}]
|
2017-01-03 17:26:09 +00:00
|
|
|
|
2017-05-08 13:47:25 +00:00
|
|
|
_exc[orth + "'ll"] = [
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: orth, LEMMA: word, NORM: word},
|
|
|
|
{ORTH: "'ll", LEMMA: "will", NORM: "will", TAG: "MD"}]
|
2017-01-03 17:26:09 +00:00
|
|
|
|
2017-05-08 13:47:25 +00:00
|
|
|
_exc[orth + "ll"] = [
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: orth, LEMMA: word, NORM: word},
|
|
|
|
{ORTH: "ll", LEMMA: "will", NORM: "will", TAG: "MD"}]
|
2017-01-03 17:26:09 +00:00
|
|
|
|
2017-05-08 13:47:25 +00:00
|
|
|
_exc[orth + "'ll've"] = [
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: orth, LEMMA: word, NORM: word},
|
|
|
|
{ORTH: "'ll", LEMMA: "will", NORM: "will", TAG: "MD"},
|
|
|
|
{ORTH: "'ve", LEMMA: "have", NORM: "have", TAG: "VB"}]
|
2017-01-03 17:26:09 +00:00
|
|
|
|
2017-05-08 13:47:25 +00:00
|
|
|
_exc[orth + "llve"] = [
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: orth, LEMMA: word, NORM: word},
|
|
|
|
{ORTH: "ll", LEMMA: "will", NORM: "will", TAG: "MD"},
|
|
|
|
{ORTH: "ve", LEMMA: "have", NORM: "have", TAG: "VB"}]
|
2017-01-03 17:26:09 +00:00
|
|
|
|
2017-05-08 13:47:25 +00:00
|
|
|
_exc[orth + "'re"] = [
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: orth, LEMMA: word, NORM: word},
|
2017-05-08 13:47:25 +00:00
|
|
|
{ORTH: "'re", LEMMA: "be", NORM: "are"}]
|
2017-01-03 17:26:09 +00:00
|
|
|
|
2017-05-08 13:47:25 +00:00
|
|
|
_exc[orth + "re"] = [
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: orth, LEMMA: word, NORM: word},
|
2017-05-08 13:47:25 +00:00
|
|
|
{ORTH: "re", LEMMA: "be", NORM: "are"}]
|
2017-01-03 17:26:09 +00:00
|
|
|
|
2017-05-08 13:47:25 +00:00
|
|
|
_exc[orth + "'ve"] = [
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: orth, LEMMA: word, NORM: word},
|
2017-05-08 13:47:25 +00:00
|
|
|
{ORTH: "'ve", LEMMA: "have", TAG: "VB"}]
|
2017-01-03 17:26:09 +00:00
|
|
|
|
2017-05-08 13:47:25 +00:00
|
|
|
_exc[orth + "ve"] = [
|
2017-01-03 22:01:31 +00:00
|
|
|
{ORTH: orth, LEMMA: word},
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: "ve", LEMMA: "have", NORM: "have", TAG: "VB"}]
|
2017-01-03 17:26:09 +00:00
|
|
|
|
2017-05-08 13:47:25 +00:00
|
|
|
_exc[orth + "'d"] = [
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: orth, LEMMA: word, NORM: word},
|
|
|
|
{ORTH: "'d", NORM: "'d"}]
|
2017-01-03 17:26:09 +00:00
|
|
|
|
2017-05-08 13:47:25 +00:00
|
|
|
_exc[orth + "d"] = [
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: orth, LEMMA: word, NORM: word},
|
2017-05-08 13:47:25 +00:00
|
|
|
{ORTH: "d"}]
|
2017-01-03 17:26:09 +00:00
|
|
|
|
2017-05-08 13:47:25 +00:00
|
|
|
_exc[orth + "'d've"] = [
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: orth, LEMMA: word, NORM: word},
|
|
|
|
{ORTH: "'d", LEMMA: "would", NORM: "would", TAG: "MD"},
|
|
|
|
{ORTH: "'ve", LEMMA: "have", NORM: "have", TAG: "VB"}]
|
2017-01-03 17:26:09 +00:00
|
|
|
|
2017-05-08 13:47:25 +00:00
|
|
|
_exc[orth + "dve"] = [
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: orth, LEMMA: word, NORM: word},
|
|
|
|
{ORTH: "d", LEMMA: "would", NORM: "would", TAG: "MD"},
|
|
|
|
{ORTH: "ve", LEMMA: "have", NORM: "have", TAG: "VB"}]
|
2017-01-03 17:26:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
# Verbs
|
|
|
|
|
|
|
|
for verb_data in [
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: "ca", LEMMA: "can", NORM: "can", TAG: "MD"},
|
|
|
|
{ORTH: "could", NORM: "could", TAG: "MD"},
|
|
|
|
{ORTH: "do", LEMMA: "do", NORM: "do"},
|
|
|
|
{ORTH: "does", LEMMA: "do", NORM: "does"},
|
|
|
|
{ORTH: "did", LEMMA: "do", NORM: "do", TAG: "VBD"},
|
|
|
|
{ORTH: "had", LEMMA: "have", NORM: "have", TAG: "VBD"},
|
|
|
|
{ORTH: "may", NORM: "may", TAG: "MD"},
|
|
|
|
{ORTH: "might", NORM: "might", TAG: "MD"},
|
|
|
|
{ORTH: "must", NORM: "must", TAG: "MD"},
|
|
|
|
{ORTH: "need", NORM: "need"},
|
|
|
|
{ORTH: "ought", NORM: "ought", TAG: "MD"},
|
|
|
|
{ORTH: "sha", LEMMA: "shall", NORM: "shall", TAG: "MD"},
|
|
|
|
{ORTH: "should", NORM: "should", TAG: "MD"},
|
|
|
|
{ORTH: "wo", LEMMA: "will", NORM: "will", TAG: "MD"},
|
|
|
|
{ORTH: "would", NORM: "would", TAG: "MD"}]:
|
2017-01-03 17:26:09 +00:00
|
|
|
verb_data_tc = dict(verb_data)
|
|
|
|
verb_data_tc[ORTH] = verb_data_tc[ORTH].title()
|
|
|
|
for data in [verb_data, verb_data_tc]:
|
2017-05-08 13:47:25 +00:00
|
|
|
_exc[data[ORTH] + "n't"] = [
|
2017-01-03 17:26:09 +00:00
|
|
|
dict(data),
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: "n't", LEMMA: "not", NORM: "not", TAG: "RB"}]
|
2017-01-03 17:26:09 +00:00
|
|
|
|
2017-05-08 13:47:25 +00:00
|
|
|
_exc[data[ORTH] + "nt"] = [
|
2017-01-03 17:26:09 +00:00
|
|
|
dict(data),
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: "nt", LEMMA: "not", NORM: "not", TAG: "RB"}]
|
2017-01-03 17:26:09 +00:00
|
|
|
|
2017-05-08 13:47:25 +00:00
|
|
|
_exc[data[ORTH] + "n't've"] = [
|
2017-01-12 10:21:01 +00:00
|
|
|
dict(data),
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: "n't", LEMMA: "not", NORM: "not", TAG: "RB"},
|
|
|
|
{ORTH: "'ve", LEMMA: "have", NORM: "have", TAG: "VB"}]
|
2017-01-03 17:26:09 +00:00
|
|
|
|
2017-05-08 13:47:25 +00:00
|
|
|
_exc[data[ORTH] + "ntve"] = [
|
2017-01-12 10:21:01 +00:00
|
|
|
dict(data),
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: "nt", LEMMA: "not", NORM: "not", TAG: "RB"},
|
|
|
|
{ORTH: "ve", LEMMA: "have", NORM: "have", TAG: "VB"}]
|
2017-01-03 17:26:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
for verb_data in [
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: "could", NORM: "could", TAG: "MD"},
|
|
|
|
{ORTH: "might", NORM: "might", TAG: "MD"},
|
|
|
|
{ORTH: "must", NORM: "must", TAG: "MD"},
|
|
|
|
{ORTH: "should", NORM: "should", TAG: "MD"}]:
|
2017-01-03 17:26:09 +00:00
|
|
|
verb_data_tc = dict(verb_data)
|
|
|
|
verb_data_tc[ORTH] = verb_data_tc[ORTH].title()
|
|
|
|
for data in [verb_data, verb_data_tc]:
|
2017-05-08 13:47:25 +00:00
|
|
|
_exc[data[ORTH] + "'ve"] = [
|
2017-01-03 17:26:09 +00:00
|
|
|
dict(data),
|
2017-05-08 13:47:25 +00:00
|
|
|
{ORTH: "'ve", LEMMA: "have", TAG: "VB"}]
|
2017-01-03 17:26:09 +00:00
|
|
|
|
2017-05-08 13:47:25 +00:00
|
|
|
_exc[data[ORTH] + "ve"] = [
|
2017-01-03 17:26:09 +00:00
|
|
|
dict(data),
|
2017-05-08 13:47:25 +00:00
|
|
|
{ORTH: "ve", LEMMA: "have", TAG: "VB"}]
|
2017-01-03 17:26:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
for verb_data in [
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: "ai", LEMMA: "be", TAG: "VBP", "number": 2},
|
|
|
|
{ORTH: "are", LEMMA: "be", NORM: "are", TAG: "VBP", "number": 2},
|
|
|
|
{ORTH: "is", LEMMA: "be", NORM: "is", TAG: "VBZ"},
|
|
|
|
{ORTH: "was", LEMMA: "be", NORM: "was"},
|
|
|
|
{ORTH: "were", LEMMA: "be", NORM: "were"}]:
|
2017-01-03 17:26:09 +00:00
|
|
|
verb_data_tc = dict(verb_data)
|
|
|
|
verb_data_tc[ORTH] = verb_data_tc[ORTH].title()
|
|
|
|
for data in [verb_data, verb_data_tc]:
|
2017-05-08 13:47:25 +00:00
|
|
|
_exc[data[ORTH] + "n't"] = [
|
2017-01-03 17:26:09 +00:00
|
|
|
dict(data),
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: "n't", LEMMA: "not", NORM: "not", TAG: "RB"}]
|
2017-01-03 17:26:09 +00:00
|
|
|
|
2017-05-08 13:47:25 +00:00
|
|
|
_exc[data[ORTH] + "nt"] = [
|
2017-01-03 17:26:09 +00:00
|
|
|
dict(data),
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: "nt", LEMMA: "not", NORM: "not", TAG: "RB"}]
|
2017-01-03 17:26:09 +00:00
|
|
|
|
2017-01-05 18:59:06 +00:00
|
|
|
|
|
|
|
# Other contractions with trailing apostrophe
|
|
|
|
|
|
|
|
for exc_data in [
|
|
|
|
{ORTH: "doin", LEMMA: "do", NORM: "doing"},
|
|
|
|
{ORTH: "goin", LEMMA: "go", NORM: "going"},
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: "nothin", LEMMA: "nothing", NORM: "nothing"},
|
|
|
|
{ORTH: "nuthin", LEMMA: "nothing", NORM: "nothing"},
|
|
|
|
{ORTH: "ol", LEMMA: "old", NORM: "old"},
|
|
|
|
{ORTH: "somethin", LEMMA: "something", NORM: "something"}]:
|
2017-01-05 18:59:06 +00:00
|
|
|
exc_data_tc = dict(exc_data)
|
|
|
|
exc_data_tc[ORTH] = exc_data_tc[ORTH].title()
|
|
|
|
for data in [exc_data, exc_data_tc]:
|
|
|
|
data_apos = dict(data)
|
|
|
|
data_apos[ORTH] = data_apos[ORTH] + "'"
|
2017-05-08 13:47:25 +00:00
|
|
|
_exc[data[ORTH]] = [dict(data)]
|
|
|
|
_exc[data_apos[ORTH]] = [dict(data_apos)]
|
2017-01-05 18:59:06 +00:00
|
|
|
|
|
|
|
|
|
|
|
# Other contractions with leading apostrophe
|
|
|
|
|
|
|
|
for exc_data in [
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: "cause", LEMMA: "because", NORM: "because"},
|
2017-01-05 18:59:06 +00:00
|
|
|
{ORTH: "em", LEMMA: PRON_LEMMA, NORM: "them"},
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: "ll", LEMMA: "will", NORM: "will"},
|
|
|
|
{ORTH: "nuff", LEMMA: "enough", NORM: "enough"}]:
|
2017-01-05 18:59:06 +00:00
|
|
|
exc_data_apos = dict(exc_data)
|
|
|
|
exc_data_apos[ORTH] = "'" + exc_data_apos[ORTH]
|
|
|
|
for data in [exc_data, exc_data_apos]:
|
2017-05-08 13:47:25 +00:00
|
|
|
_exc[data[ORTH]] = [dict(data)]
|
2017-01-05 18:59:06 +00:00
|
|
|
|
|
|
|
|
2017-03-12 12:44:10 +00:00
|
|
|
# Times
|
|
|
|
|
|
|
|
for h in range(1, 12 + 1):
|
|
|
|
for period in ["a.m.", "am"]:
|
2017-05-08 14:38:16 +00:00
|
|
|
_exc["%d%s" % (h, period)] = [
|
|
|
|
{ORTH: "%d" % h},
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: period, LEMMA: "a.m.", NORM: "a.m."}]
|
2017-03-12 12:44:10 +00:00
|
|
|
for period in ["p.m.", "pm"]:
|
2017-05-08 14:38:16 +00:00
|
|
|
_exc["%d%s" % (h, period)] = [
|
|
|
|
{ORTH: "%d" % h},
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: period, LEMMA: "p.m.", NORM: "p.m."}]
|
2017-03-12 12:44:10 +00:00
|
|
|
|
|
|
|
|
2017-01-05 18:59:06 +00:00
|
|
|
# Rest
|
|
|
|
|
2017-05-08 13:47:25 +00:00
|
|
|
_other_exc = {
|
2017-01-05 18:59:06 +00:00
|
|
|
"y'all": [
|
|
|
|
{ORTH: "y'", LEMMA: PRON_LEMMA, NORM: "you"},
|
2017-05-08 13:47:25 +00:00
|
|
|
{ORTH: "all"}],
|
2017-01-05 18:59:06 +00:00
|
|
|
|
|
|
|
"yall": [
|
|
|
|
{ORTH: "y", LEMMA: PRON_LEMMA, NORM: "you"},
|
2017-05-08 13:47:25 +00:00
|
|
|
{ORTH: "all"}],
|
2017-01-05 18:59:06 +00:00
|
|
|
|
|
|
|
"how'd'y": [
|
|
|
|
{ORTH: "how", LEMMA: "how"},
|
|
|
|
{ORTH: "'d", LEMMA: "do"},
|
2017-05-08 13:47:25 +00:00
|
|
|
{ORTH: "'y", LEMMA: PRON_LEMMA, NORM: "you"}],
|
2017-01-05 18:59:06 +00:00
|
|
|
|
|
|
|
"How'd'y": [
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: "How", LEMMA: "how", NORM: "how"},
|
2017-01-05 18:59:06 +00:00
|
|
|
{ORTH: "'d", LEMMA: "do"},
|
2017-05-08 13:47:25 +00:00
|
|
|
{ORTH: "'y", LEMMA: PRON_LEMMA, NORM: "you"}],
|
2017-01-05 18:59:06 +00:00
|
|
|
|
|
|
|
"not've": [
|
|
|
|
{ORTH: "not", LEMMA: "not", TAG: "RB"},
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: "'ve", LEMMA: "have", NORM: "have", TAG: "VB"}],
|
2017-01-05 18:59:06 +00:00
|
|
|
|
|
|
|
"notve": [
|
|
|
|
{ORTH: "not", LEMMA: "not", TAG: "RB"},
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: "ve", LEMMA: "have", NORM: "have", TAG: "VB"}],
|
2017-01-05 18:59:06 +00:00
|
|
|
|
|
|
|
"Not've": [
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: "Not", LEMMA: "not", NORM: "not", TAG: "RB"},
|
|
|
|
{ORTH: "'ve", LEMMA: "have", NORM: "have", TAG: "VB"}],
|
2017-01-05 18:59:06 +00:00
|
|
|
|
|
|
|
"Notve": [
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: "Not", LEMMA: "not", NORM: "not", TAG: "RB"},
|
|
|
|
{ORTH: "ve", LEMMA: "have", NORM: "have", TAG: "VB"}],
|
2017-01-05 18:59:06 +00:00
|
|
|
|
|
|
|
"cannot": [
|
|
|
|
{ORTH: "can", LEMMA: "can", TAG: "MD"},
|
2017-05-08 13:47:25 +00:00
|
|
|
{ORTH: "not", LEMMA: "not", TAG: "RB"}],
|
2017-01-05 18:59:06 +00:00
|
|
|
|
|
|
|
"Cannot": [
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: "Can", LEMMA: "can", NORM: "can", TAG: "MD"},
|
2017-05-08 13:47:25 +00:00
|
|
|
{ORTH: "not", LEMMA: "not", TAG: "RB"}],
|
2017-01-05 18:59:06 +00:00
|
|
|
|
|
|
|
"gonna": [
|
|
|
|
{ORTH: "gon", LEMMA: "go", NORM: "going"},
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: "na", LEMMA: "to", NORM: "to"}],
|
2017-01-05 18:59:06 +00:00
|
|
|
|
|
|
|
"Gonna": [
|
|
|
|
{ORTH: "Gon", LEMMA: "go", NORM: "going"},
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: "na", LEMMA: "to", NORM: "to"}],
|
2017-01-05 18:59:06 +00:00
|
|
|
|
|
|
|
"gotta": [
|
|
|
|
{ORTH: "got"},
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: "ta", LEMMA: "to", NORM: "to"}],
|
2017-01-05 18:59:06 +00:00
|
|
|
|
|
|
|
"Gotta": [
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: "Got", NORM: "got"},
|
|
|
|
{ORTH: "ta", LEMMA: "to", NORM: "to"}],
|
2017-01-05 18:59:06 +00:00
|
|
|
|
|
|
|
"let's": [
|
|
|
|
{ORTH: "let"},
|
2017-05-08 13:47:25 +00:00
|
|
|
{ORTH: "'s", LEMMA: PRON_LEMMA, NORM: "us"}],
|
2017-01-05 18:59:06 +00:00
|
|
|
|
|
|
|
"Let's": [
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: "Let", LEMMA: "let", NORM: "let"},
|
2017-05-08 13:47:25 +00:00
|
|
|
{ORTH: "'s", LEMMA: PRON_LEMMA, NORM: "us"}]
|
2017-01-05 18:59:06 +00:00
|
|
|
}
|
|
|
|
|
2017-05-08 13:47:25 +00:00
|
|
|
_exc.update(_other_exc)
|
2017-01-05 18:59:06 +00:00
|
|
|
|
2016-12-08 11:47:01 +00:00
|
|
|
|
2017-05-08 13:47:25 +00:00
|
|
|
for exc_data in [
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: "'S", LEMMA: "'s", NORM: "'s"},
|
|
|
|
{ORTH: "'s", LEMMA: "'s", NORM: "'s"},
|
|
|
|
{ORTH: "\u2018S", LEMMA: "'s", NORM: "'s"},
|
|
|
|
{ORTH: "\u2018s", LEMMA: "'s", NORM: "'s"},
|
|
|
|
{ORTH: "and/or", LEMMA: "and/or", NORM: "and/or", TAG: "CC"},
|
|
|
|
{ORTH: "w/o", LEMMA: "without", NORM: "without"},
|
2017-05-08 13:47:25 +00:00
|
|
|
{ORTH: "'re", LEMMA: "be", NORM: "are"},
|
2017-06-03 18:27:16 +00:00
|
|
|
{ORTH: "'Cause", LEMMA: "because", NORM: "because"},
|
|
|
|
{ORTH: "'cause", LEMMA: "because", NORM: "because"},
|
|
|
|
{ORTH: "'cos", LEMMA: "because", NORM: "because"},
|
|
|
|
{ORTH: "'Cos", LEMMA: "because", NORM: "because"},
|
|
|
|
{ORTH: "'coz", LEMMA: "because", NORM: "because"},
|
|
|
|
{ORTH: "'Coz", LEMMA: "because", NORM: "because"},
|
|
|
|
{ORTH: "'cuz", LEMMA: "because", NORM: "because"},
|
|
|
|
{ORTH: "'Cuz", LEMMA: "because", NORM: "because"},
|
|
|
|
{ORTH: "'bout", LEMMA: "about", NORM: "about"},
|
|
|
|
{ORTH: "ma'am", LEMMA: "madam", NORM: "madam"},
|
|
|
|
{ORTH: "Ma'am", LEMMA: "madam", NORM: "madam"},
|
|
|
|
{ORTH: "o'clock", LEMMA: "o'clock", NORM: "o'clock"},
|
|
|
|
{ORTH: "O'clock", LEMMA: "o'clock", NORM: "o'clock"},
|
|
|
|
|
|
|
|
{ORTH: "Mt.", LEMMA: "Mount", NORM: "Mount"},
|
|
|
|
{ORTH: "Ak.", LEMMA: "Alaska", NORM: "Alaska"},
|
|
|
|
{ORTH: "Ala.", LEMMA: "Alabama", NORM: "Alabama"},
|
|
|
|
{ORTH: "Apr.", LEMMA: "April", NORM: "April"},
|
|
|
|
{ORTH: "Ariz.", LEMMA: "Arizona", NORM: "Arizona"},
|
|
|
|
{ORTH: "Ark.", LEMMA: "Arkansas", NORM: "Arkansas"},
|
|
|
|
{ORTH: "Aug.", LEMMA: "August", NORM: "August"},
|
|
|
|
{ORTH: "Calif.", LEMMA: "California", NORM: "California"},
|
|
|
|
{ORTH: "Colo.", LEMMA: "Colorado", NORM: "Colorado"},
|
|
|
|
{ORTH: "Conn.", LEMMA: "Connecticut", NORM: "Connecticut"},
|
|
|
|
{ORTH: "Dec.", LEMMA: "December", NORM: "December"},
|
|
|
|
{ORTH: "Del.", LEMMA: "Delaware", NORM: "Delaware"},
|
|
|
|
{ORTH: "Feb.", LEMMA: "February", NORM: "February"},
|
|
|
|
{ORTH: "Fla.", LEMMA: "Florida", NORM: "Florida"},
|
|
|
|
{ORTH: "Ga.", LEMMA: "Georgia", NORM: "Georgia"},
|
|
|
|
{ORTH: "Ia.", LEMMA: "Iowa", NORM: "Iowa"},
|
|
|
|
{ORTH: "Id.", LEMMA: "Idaho", NORM: "Idaho"},
|
|
|
|
{ORTH: "Ill.", LEMMA: "Illinois", NORM: "Illinois"},
|
|
|
|
{ORTH: "Ind.", LEMMA: "Indiana", NORM: "Indiana"},
|
|
|
|
{ORTH: "Jan.", LEMMA: "January", NORM: "January"},
|
|
|
|
{ORTH: "Jul.", LEMMA: "July", NORM: "July"},
|
|
|
|
{ORTH: "Jun.", LEMMA: "June", NORM: "June"},
|
|
|
|
{ORTH: "Kan.", LEMMA: "Kansas", NORM: "Kansas"},
|
|
|
|
{ORTH: "Kans.", LEMMA: "Kansas", NORM: "Kansas"},
|
|
|
|
{ORTH: "Ky.", LEMMA: "Kentucky", NORM: "Kentucky"},
|
|
|
|
{ORTH: "La.", LEMMA: "Louisiana", NORM: "Louisiana"},
|
|
|
|
{ORTH: "Mar.", LEMMA: "March", NORM: "March"},
|
|
|
|
{ORTH: "Mass.", LEMMA: "Massachusetts", NORM: "Massachusetts"},
|
|
|
|
{ORTH: "May.", LEMMA: "May", NORM: "May"},
|
|
|
|
{ORTH: "Mich.", LEMMA: "Michigan", NORM: "Michigan"},
|
|
|
|
{ORTH: "Minn.", LEMMA: "Minnesota", NORM: "Minnesota"},
|
|
|
|
{ORTH: "Miss.", LEMMA: "Mississippi", NORM: "Mississippi"},
|
|
|
|
{ORTH: "N.C.", LEMMA: "North Carolina", NORM: "North Carolina"},
|
|
|
|
{ORTH: "N.D.", LEMMA: "North Dakota", NORM: "North Dakota"},
|
|
|
|
{ORTH: "N.H.", LEMMA: "New Hampshire", NORM: "New Hampshire"},
|
|
|
|
{ORTH: "N.J.", LEMMA: "New Jersey", NORM: "New Jersey"},
|
|
|
|
{ORTH: "N.M.", LEMMA: "New Mexico", NORM: "New Mexico"},
|
|
|
|
{ORTH: "N.Y.", LEMMA: "New York", NORM: "New York"},
|
|
|
|
{ORTH: "Neb.", LEMMA: "Nebraska", NORM: "Nebraska"},
|
|
|
|
{ORTH: "Nebr.", LEMMA: "Nebraska", NORM: "Nebraska"},
|
|
|
|
{ORTH: "Nev.", LEMMA: "Nevada", NORM: "Nevada"},
|
|
|
|
{ORTH: "Nov.", LEMMA: "November", NORM: "November"},
|
|
|
|
{ORTH: "Oct.", LEMMA: "October", NORM: "October"},
|
|
|
|
{ORTH: "Okla.", LEMMA: "Oklahoma", NORM: "Oklahoma"},
|
|
|
|
{ORTH: "Ore.", LEMMA: "Oregon", NORM: "Oregon"},
|
|
|
|
{ORTH: "Pa.", LEMMA: "Pennsylvania", NORM: "Pennsylvania"},
|
|
|
|
{ORTH: "S.C.", LEMMA: "South Carolina", NORM: "South Carolina"},
|
|
|
|
{ORTH: "Sep.", LEMMA: "September", NORM: "September"},
|
|
|
|
{ORTH: "Sept.", LEMMA: "September", NORM: "September"},
|
|
|
|
{ORTH: "Tenn.", LEMMA: "Tennessee", NORM: "Tennessee"},
|
|
|
|
{ORTH: "Va.", LEMMA: "Virginia", NORM: "Virginia"},
|
|
|
|
{ORTH: "Wash.", LEMMA: "Washington", NORM: "Washington"},
|
|
|
|
{ORTH: "Wis.", LEMMA: "Wisconsin", NORM: "Wisconsin"}]:
|
2017-05-08 13:47:25 +00:00
|
|
|
_exc[exc_data[ORTH]] = [dict(exc_data)]
|
|
|
|
|
|
|
|
|
|
|
|
for orth in [
|
|
|
|
"'d", "a.m.", "Adm.", "Bros.", "co.", "Co.", "Corp.", "D.C.", "Dr.", "e.g.",
|
|
|
|
"E.g.", "E.G.", "Gen.", "Gov.", "i.e.", "I.e.", "I.E.", "Inc.", "Jr.",
|
|
|
|
"Ltd.", "Md.", "Messrs.", "Mo.", "Mont.", "Mr.", "Mrs.", "Ms.", "p.m.",
|
|
|
|
"Ph.D.", "Rep.", "Rev.", "Sen.", "St.", "vs."]:
|
|
|
|
_exc[orth] = [{ORTH: orth}]
|
|
|
|
|
|
|
|
|
|
|
|
for string in _exclude:
|
|
|
|
if string in _exc:
|
|
|
|
_exc.pop(string)
|
|
|
|
|
|
|
|
|
|
|
|
TOKENIZER_EXCEPTIONS = dict(_exc)
|