Beispiel #1
0
 def test_word_split_TA0(self):
     self.assertTrue(self.TVU.isWord(u"ஆங்கிலம்நாடு"))
     word = u"ஆங்கிலம்நாடுஆமை"
     parts = [[u"ஆங்கிலம்நாடு", u"ஆ", u"மை"], [u"ஆங்கிலம்நாடு", u"ஆமை"],
              [u"ஆங்கிலம்", u"நாடு", u"ஆமை"],
              [u"ஆங்கிலம்", u"நாடு", u"ஆ", u"மை"]]
     actual = wordutils.word_split(word, self.TVU)
     self.assertEqual(sorted(parts), sorted(actual))
     for lst in actual:
         jn_wrd = u"".join(lst)
         self.assertEqual(jn_wrd, word)
     return
 def test_word_split_TA0(self):
     self.assertTrue(self.TVU.isWord(u"ஆங்கிலம்நாடு"))
     word = u"ஆங்கிலம்நாடுஆமை"
     parts = [
         [u"ஆங்கிலம்நாடு", u"ஆ", u"மை"],
         [u"ஆங்கிலம்நாடு", u"ஆமை"],
         [u"ஆங்கிலம்", u"நாடு", u"ஆமை"],
         [u"ஆங்கிலம்", u"நாடு", u"ஆ", u"மை"],
     ]
     actual = wordutils.word_split(word, self.TVU)
     self.assertEqual(sorted(parts), sorted(actual))
     for lst in actual:
         jn_wrd = u"".join(lst)
         self.assertEqual(jn_wrd, word)
     return
 def test_twoway_EN2(self):
     word = u"motherinlaw"
     parts = [[u"moth", u"erin", u"law"], [u"mother", u"in", u"law"]]
     actual = wordutils.word_split(word, self.ENG)
     self.assertEqual(parts, actual)
 def test_conjunctions(self):
     word = u"motherrand"
     parts = [[u"moth", u"errand"], [u"mother", u"rand"]]
     actual = wordutils.word_split(word, self.ENG)
     self.assertEqual(parts, actual)
     return
 def test_word_split_EN(self):
     word = "wordlist"
     parts = [["word", "list"]]
     actual = wordutils.word_split(word, self.ENG)
     self.assertEqual(parts, actual)
 def test_word_split_TA(self):
     word = u"ஒருதலைகாதல்"
     parts = [[u"ஒரு", u"தலை", u"காதல்"], [u"ஒருதலை", u"காதல்"]]
     actual = wordutils.word_split(word, self.TVU)
     self.assertEqual(parts, actual)
Beispiel #7
0
# -*- coding: utf-8 -*-
# (C) 2015 Muthiah Annamalai

from solthiruthi.dictionary import *
from tamil import wordutils, utf8
from ngram import edit_distance
import math
from pprint import pprint

TVU, TVU_size = DictionaryBuilder.create(TamilVU)
word2, parts2 = "ஒருதலைகாதல்", ["ஒருதலை", "காதல்"]
actual2 = wordutils.word_split(word2, TVU)
pprint(actual2)

TVU, TVU_size = DictionaryBuilder.create(EnglishLinux)
TVU.add('erin')
word2, parts2 = "motherinlaw", ["ஒருதலை", "காதல்"]
word3 = None
while True:
    if not word3:
        word3 = 'bullpen'
    for w in wordutils.permutagrams(word3, TVU):
        print((">>>> %s" % w))
    word3 = input("enter a word>> ")
# -*- coding: utf-8 -*-
# (C) 2015 Muthiah Annamalai

from solthiruthi.dictionary import *
from tamil import wordutils, utf8
from ngram import edit_distance
import math
from pprint import pprint

TVU,TVU_size = DictionaryBuilder.create(TamilVU)    
word2,parts2 = u"ஒருதலைகாதல்", [u"ஒருதலை",u"காதல்"]
actual2 = wordutils.word_split(word2,TVU)
pprint(actual2)

TVU,TVU_size = DictionaryBuilder.create(EnglishLinux)    
TVU.add('erin')
word2,parts2 = u"motherinlaw", [u"ஒருதலை",u"காதல்"]
word3 = None
while True:
    if not word3:
        word3 = u'bullpen'
    for w in wordutils.permutagrams(word3,TVU):
        print (u">>>> %s"%w)
    word3 = raw_input("enter a word>> ")
Beispiel #9
0
 def test_twoway_EN2(self):
     word = u'motherinlaw'
     parts = [[u'moth', u'erin', u'law'], [u'mother', u'in', u'law']]
     actual = wordutils.word_split(word, self.ENG)
     self.assertEqual(parts, actual)
Beispiel #10
0
 def test_conjunctions(self):
     word = u"motherrand"
     parts = [[u'moth', u'errand'], [u'mother', u'rand']]
     actual = wordutils.word_split(word, self.ENG)
     self.assertEqual(parts, actual)
     return
Beispiel #11
0
 def test_word_split_EN(self):
     word = 'wordlist'
     parts = [['word', 'list']]
     actual = wordutils.word_split(word, self.ENG)
     self.assertEqual(parts, actual)
 def test_twoway_EN2(self):
     word = u"motherinlaw"
     parts = [[u"moth", u"erin", u"law"], [u"mother", u"in", u"law"]]
     actual = wordutils.word_split(word, self.ENG)
     self.assertEqual(parts, actual)
 def test_conjunctions(self):
     word = u"motherrand"
     parts = [[u"moth", u"errand"], [u"mother", u"rand"]]
     actual = wordutils.word_split(word, self.ENG)
     self.assertEqual(parts, actual)
     return
 def test_word_split_EN(self):
     word = "wordlist"
     parts = [["word", "list"]]
     actual = wordutils.word_split(word, self.ENG)
     self.assertEqual(parts, actual)
 def test_word_split_TA(self):
     word = u"ஒருதலைகாதல்"
     parts = [[u"ஒரு", u"தலை", u"காதல்"], [u"ஒருதலை", u"காதல்"]]
     actual = wordutils.word_split(word, self.TVU)
     self.assertEqual(parts, actual)