def __init__(self, settings, look_ahead=3):
        """Loads a gazetteer file. Can take some time!

        Parameters
        -----------

        settings: dict
            Global configuration dictionary.
        look_ahead: int
            A number of tokens to check to compose phrases.

        """
        self.look_ahead = look_ahead
        self.data = defaultdict(set)
        with codecs.open(settings.GAZETTEER_FILE, 'rb', encoding="utf8") as f:
            for ln in f:
                word, lbl = ln.strip().rsplit("\t", 1)
                self.data[word].add(lbl)
def __init__ ( self , settings , look_ahead = 3 ) : self . look_ahead = look_ahead self . data = defaultdict ( set ) with codecs . open ( settings . GAZETTEER_FILE , 'rb' , encoding = "utf8" ) as f : for ln in f : word , lbl = ln . strip ( ) . rsplit ( "\t" , 1 ) self . data [ word ] . add ( lbl )
Loads a gazetteer file. Can take some time!

        Parameters
        -----------

        settings: dict
            Global configuration dictionary.
        look_ahead: int
            A number of tokens to check to compose phrases.