from utils.text.vocab import Vocab

__author__ = 'victor'
import os
import numpy as np

mydir = os.path.dirname(os.path.abspath(__file__))

class WordVectors(object):
    pass


class Senna(WordVectors):

    def __init__(self):
        super(Senna, self).__init__()
        self.word_list = os.path.join(mydir, 'senna', 'words.lst')
        self.embeddings_list = os.path.join(mydir, 'senna', 'embeddings.txt')
        self.vocab_, self.word2emb = None, None

    @property
    def vocab(self):
        if self.vocab_ is None:
            self.vocab_ = Vocab(unk='UNKNOWN')
            with open(self.word_list) as f:
                for l in f:
                    self.vocab_.add(l.strip("\n"))
        return self.vocab_
