Find jurisdiction
This commit is contained in:
parent
c2c7bf069b
commit
e3b81c05f4
83
dev-0/out.tsv
Normal file
83
dev-0/out.tsv
Normal file
@ -0,0 +1,83 @@
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Georgia
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Massachusetts
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Washington
|
||||
jurisdiction=California
|
||||
jurisdiction=New_Jersey
|
||||
jurisdiction=California
|
||||
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Massachusetts
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Minnesota
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Virginia
|
||||
jurisdiction=North_Carolina
|
||||
jurisdiction=Arizona
|
||||
jurisdiction=Indiana
|
||||
jurisdiction=New_Jersey
|
||||
jurisdiction=California
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Georgia
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Nevada
|
||||
jurisdiction=California
|
||||
jurisdiction=Minnesota
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Kentucky
|
||||
jurisdiction=Minnesota
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Michigan
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Minnesota
|
||||
jurisdiction=California
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Illinois
|
||||
jurisdiction=Minnesota
|
||||
jurisdiction=Texas
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Georgia
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Oregon
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=California
|
||||
jurisdiction=California
|
||||
jurisdiction=California
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Idaho
|
||||
jurisdiction=Washington
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=New_York
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Oregon
|
||||
jurisdiction=Washington
|
||||
jurisdiction=Virginia
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=New_York
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Idaho
|
||||
jurisdiction=Delaware
|
||||
|
||||
jurisdiction=Texas
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Washington
|
||||
jurisdiction=New_York
|
||||
jurisdiction=Washington
|
||||
jurisdiction=Pennsylvania
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Illinois
|
|
53
run.py
Normal file
53
run.py
Normal file
@ -0,0 +1,53 @@
|
||||
#!/usr/bin/env python
|
||||
# coding: utf-8
|
||||
|
||||
# In[13]:
|
||||
|
||||
|
||||
import re
|
||||
|
||||
|
||||
# In[1]:
|
||||
|
||||
|
||||
state_names = ["Alaska", "Alabama", "Arkansas", "American Samoa", "Arizona", "California", "Colorado", "Connecticut", "District ", "of Columbia", "Delaware", "Florida", "Georgia", "Guam", "Hawaii", "Iowa", "Idaho", "Illinois", "Indiana", "Kansas", "Kentucky", "Louisiana", "Massachusetts", "Maryland", "Maine", "Michigan", "Minnesota", "Missouri", "Mississippi", "Montana", "North Carolina", "North Dakota", "Nebraska", "New Hampshire", "New Jersey", "New Mexico", "Nevada", "New York", "Ohio", "Oklahoma", "Oregon", "Pennsylvania", "Puerto Rico", "Rhode Island", "South Carolina", "South Dakota", "Tennessee", "Texas", "Utah", "Virginia", "Virgin Islands", "Vermont", "Washington", "Wisconsin", "West Virginia", "Wyoming"]
|
||||
regex = re.compile(r'\b(' + '|'.join(state_names) + r')\b')
|
||||
|
||||
|
||||
# In[43]:
|
||||
|
||||
|
||||
with open('dev-0/in.tsv', 'r', encoding='utf8') as file:
|
||||
lines = file.readlines()
|
||||
|
||||
|
||||
# In[44]:
|
||||
|
||||
|
||||
with open('dev-0/out.tsv', 'w') as file:
|
||||
for line in lines:
|
||||
jur = regex.search(line)
|
||||
if jur:
|
||||
file.write('jurisdiction=' + jur.group().replace(' ', '_') +'\n')
|
||||
else:
|
||||
file.write('\n')
|
||||
|
||||
|
||||
# In[41]:
|
||||
|
||||
|
||||
with open('test-A/in.tsv', 'r', encoding='utf8') as file:
|
||||
lines = file.readlines()
|
||||
|
||||
|
||||
# In[42]:
|
||||
|
||||
|
||||
with open('test-A/out.tsv', 'w') as file:
|
||||
for line in lines:
|
||||
jur = regex.search(line)
|
||||
if jur:
|
||||
file.write('jurisdiction=' + jur.group().replace(' ', '_') +'\n')
|
||||
else:
|
||||
file.write('\n')
|
||||
|
203
test-A/out.tsv
Normal file
203
test-A/out.tsv
Normal file
@ -0,0 +1,203 @@
|
||||
jurisdiction=Ohio
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Indiana
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Nevada
|
||||
jurisdiction=Utah
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Maryland
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=New_York
|
||||
jurisdiction=California
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=New_York
|
||||
jurisdiction=Georgia
|
||||
jurisdiction=Texas
|
||||
jurisdiction=California
|
||||
jurisdiction=Washington
|
||||
|
||||
jurisdiction=Florida
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Florida
|
||||
jurisdiction=New_York
|
||||
jurisdiction=California
|
||||
jurisdiction=Florida
|
||||
jurisdiction=New_York
|
||||
jurisdiction=Washington
|
||||
jurisdiction=Texas
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Washington
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Nevada
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=California
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=California
|
||||
jurisdiction=Virginia
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Florida
|
||||
jurisdiction=California
|
||||
jurisdiction=Virginia
|
||||
jurisdiction=Pennsylvania
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Vermont
|
||||
jurisdiction=Virginia
|
||||
jurisdiction=California
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=New_Jersey
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Texas
|
||||
jurisdiction=Massachusetts
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=New_York
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Pennsylvania
|
||||
jurisdiction=District_
|
||||
jurisdiction=California
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Massachusetts
|
||||
jurisdiction=Connecticut
|
||||
jurisdiction=California
|
||||
jurisdiction=Texas
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=District_
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Oregon
|
||||
jurisdiction=Minnesota
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Texas
|
||||
jurisdiction=Colorado
|
||||
jurisdiction=Colorado
|
||||
jurisdiction=Nevada
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Kansas
|
||||
jurisdiction=Wisconsin
|
||||
jurisdiction=New_Jersey
|
||||
jurisdiction=New_York
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Virginia
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Nevada
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=New_Jersey
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Minnesota
|
||||
jurisdiction=Connecticut
|
||||
jurisdiction=North_Carolina
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Florida
|
||||
jurisdiction=Washington
|
||||
jurisdiction=Ohio
|
||||
jurisdiction=New_York
|
||||
jurisdiction=Georgia
|
||||
jurisdiction=New_York
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Colorado
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Ohio
|
||||
jurisdiction=Minnesota
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=California
|
||||
jurisdiction=Connecticut
|
||||
jurisdiction=Maryland
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Utah
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Utah
|
||||
jurisdiction=Colorado
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=California
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Virginia
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Texas
|
||||
jurisdiction=Massachusetts
|
||||
jurisdiction=Colorado
|
||||
jurisdiction=New_York
|
||||
jurisdiction=Michigan
|
||||
jurisdiction=Pennsylvania
|
||||
jurisdiction=New_York
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Texas
|
||||
jurisdiction=Minnesota
|
||||
jurisdiction=Ohio
|
||||
jurisdiction=Oregon
|
||||
jurisdiction=New_Jersey
|
||||
jurisdiction=Florida
|
||||
jurisdiction=Oregon
|
||||
jurisdiction=Massachusetts
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=California
|
||||
jurisdiction=Maryland
|
||||
jurisdiction=Illinois
|
||||
jurisdiction=California
|
||||
jurisdiction=Virginia
|
||||
jurisdiction=Tennessee
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Minnesota
|
||||
jurisdiction=Ohio
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=New_Jersey
|
||||
jurisdiction=Nevada
|
||||
jurisdiction=Indiana
|
||||
jurisdiction=Virginia
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=New_York
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=New_York
|
||||
jurisdiction=Delaware
|
||||
|
||||
jurisdiction=Louisiana
|
||||
jurisdiction=Georgia
|
||||
jurisdiction=New_York
|
||||
jurisdiction=New_York
|
||||
jurisdiction=Oregon
|
||||
jurisdiction=Nevada
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=North_Carolina
|
||||
jurisdiction=Florida
|
||||
jurisdiction=Georgia
|
||||
jurisdiction=California
|
||||
jurisdiction=New_York
|
||||
|
||||
jurisdiction=New_York
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Georgia
|
||||
jurisdiction=New_Jersey
|
||||
jurisdiction=Minnesota
|
||||
jurisdiction=North_Carolina
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Kentucky
|
||||
jurisdiction=Nevada
|
||||
jurisdiction=Missouri
|
||||
jurisdiction=Utah
|
||||
jurisdiction=Connecticut
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Georgia
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Washington
|
||||
jurisdiction=California
|
||||
jurisdiction=California
|
||||
jurisdiction=Maryland
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Pennsylvania
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=District_
|
||||
jurisdiction=Indiana
|
||||
jurisdiction=Nevada
|
||||
jurisdiction=Nevada
|
||||
jurisdiction=Delaware
|
||||
jurisdiction=California
|
||||
jurisdiction=Colorado
|
||||
|
|
Loading…
Reference in New Issue
Block a user