Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion lexnlp/config/en/company_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def __repr__(self):


default_company_types_file_path = os.path.join(os.path.dirname(__file__), 'company_types.csv')

kronicle_company_types_file_path = os.path.join(os.path.dirname(__file__), 'kronicle_company_types.csv')

def get_company_types(file_path=None) -> Dict[str, CompanyDescriptor]:
ret = {}
Expand All @@ -68,6 +68,17 @@ def get_company_types(file_path=None) -> Dict[str, CompanyDescriptor]:
ret[alias] = CompanyDescriptor(alias, abbr, label)
if alias_dot != alias:
ret[alias_dot] = CompanyDescriptor(alias_dot, abbr, label)

with open(kronicle_company_types_file_path, encoding="utf-8") as f:
for row in csv.DictReader(f):
alias_dot = row['Alias'].strip(' ').lower()
alias = alias_dot.strip('.')
abbr = row['Abbreviation'].strip()
label = row['Label'].strip()
ret[alias] = CompanyDescriptor(alias, abbr, label)
if alias_dot != alias:
ret[alias_dot] = CompanyDescriptor(alias_dot, abbr, label)

return ret


Expand Down
Loading