Example #1
0
 def __init__(self, sentences_fl_path, language):
     if language == "rus" or language == "spa":
         self.parser = MinLFSParser(open(sentences_fl_path, "rb"))
     elif language == "eng":
         self.parser = MinBoxerLFSParser(open(sentences_fl_path, "rb"))
     else:
         raise Exception("Unsupported language: %s" % language)
Example #2
0
 def __init__(self, sentences_fl_path, language):
     if language == "rus" or language == "spa":
         self.parser = MinLFSParser(open(sentences_fl_path, "rb"))
     elif language == "eng":
         self.parser = MinBoxerLFSParser(open(sentences_fl_path, "rb"))
     else:
         raise Exception("Unsupported language: %s" % language)
Example #3
0
class LFSentenceStream(object):
    def __init__(self, sentences_fl_path, language):
        if language == "rus" or language == "spa":
            self.parser = MinLFSParser(open(sentences_fl_path, "rb"))
        elif language == "eng":
            self.parser = MinBoxerLFSParser(open(sentences_fl_path, "rb"))
        else:
            raise Exception("Unsupported language: %s" % language)

    def __iter__(self):
        return self.parser.__iter__()
Example #4
0
class LFSentenceStream(object):
    def __init__(self, sentences_fl_path, language):
        if language == "rus" or language == "spa":
            self.parser = MinLFSParser(open(sentences_fl_path, "rb"))
        elif language == "eng":
            self.parser = MinBoxerLFSParser(open(sentences_fl_path, "rb"))
        else:
            raise Exception("Unsupported language: %s" % language)

    def __iter__(self):
        return self.parser.__iter__()