Sha256: daa273a84f683781f2ffd37c0bc405b8907bd926647cbec97ae47f47595cf912

Contents?: true

Size: 744 Bytes

Versions: 5

Compression:

Stored size: 744 Bytes

Contents

# coding=utf-8

__author__ = 'Josu Bermudez <josu.bermudez@deusto.es>'
__date__ = '11/15/12'

from ... import properties

import os


locations_and_demonyms = []
demonyms = []

demonym_by_location = {}


def load_dict(file_name):
    """ Load the demonym and place in memory."""
    demonym_file = open(file_name)
    for line in demonym_file:
        line = line.lower()
        if line[0] != "#":
            tokens = line.split("\t")
            locations_and_demonyms.extend(tokens)
            demonyms.extend(tokens[1:])
            demonym_by_location[tokens[0]] = set(tokens[1:])
    locations_and_demonyms.extend(locations_and_demonyms)

load_dict(os.path.join(properties.module_path, "files/demonym/{0}.txt".format(properties.lang)))

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
opener-coreference-base-2.1.1 core/corefgraph/resources/demonym/__init__.py
opener-coreference-base-2.1.0 core/corefgraph/resources/demonym/__init__.py
opener-coreference-base-2.0.3 core/corefgraph/resources/demonym/__init__.py
opener-coreference-base-2.0.2 core/corefgraph/resources/demonym/__init__.py
opener-coreference-base-2.0.1 core/corefgraph/resources/demonym/__init__.py