class Test_StopWordRemoverTest(unittest.TestCase):
    def setUp(self):
        self.dictionary = ArrayDictionary(['di', 'ke'])
        self.stopWordRemover = StopWordRemover(self.dictionary)
        return super(Test_StopWordRemoverTest, self).setUp()

    def test_getDictionaryPreserveInstance(self):
        self.assertEqual(self.dictionary, self.stopWordRemover.get_dictionary())

    def test_removeStopWord(self):
        self.assertEquals('pergi sekolah', self.stopWordRemover.remove('pergi ke sekolah'))
        self.assertEquals('makan rumah', self.stopWordRemover.remove('makan di rumah'))
Example #2
0
class Test_StopWordRemoverTest(unittest.TestCase):
    def setUp(self):
        self.dictionary = ArrayDictionary(['di', 'ke'])
        self.stopWordRemover = StopWordRemover(self.dictionary)
        return super(Test_StopWordRemoverTest, self).setUp()

    def test_getDictionaryPreserveInstance(self):
        self.assertEqual(self.dictionary,
                         self.stopWordRemover.get_dictionary())

    def test_removeStopWord(self):
        self.assertEquals('pergi sekolah',
                          self.stopWordRemover.remove('pergi ke sekolah'))
        self.assertEquals('makan rumah',
                          self.stopWordRemover.remove('makan di rumah'))
Example #3
0
    def create_stop_word_remover(self, isDev=False):
        if isDev:
            stopWords = self.get_stop_words()
            dictionary = ArrayDictionary(stopWords)
        else:
            dictionary = self.get_prod_stop_word_dictionary()

        stopWordRemover = StopWordRemover(dictionary)
        return stopWordRemover
Example #4
0
 def setUp(self):
     self.dictionary = ArrayDictionary(['di', 'ke'])
     self.stopWordRemover = StopWordRemover(self.dictionary)
     return super(Test_StopWordRemoverTest, self).setUp()
    def create_stop_word_remover(self):
        stopWords = self.get_stop_words()
        dictionary = ArrayDictionary(stopWords)
        stopWordRemover = StopWordRemover(dictionary)

        return stopWordRemover
 def setUp(self):
     self.dictionary = ArrayDictionary(['di', 'ke'])
     self.stopWordRemover = StopWordRemover(self.dictionary)
     return super(Test_StopWordRemoverTest, self).setUp()