Esempio n. 1
0
 def test_swadesh_coptic(self):
     swadesh = Swadesh('cop')
     first_word = 'ⲁⲛⲟⲕ'
     match = swadesh.words()[0]
     self.assertEqual(first_word, match)
     turn = ['ⲡⲱⲱⲛⲉ', 'ⲕⲧⲟ']
     match = swadesh.words()[125]
     self.assertEqual(turn, match)
     match = len(swadesh.words())
     self.assertEqual(match, 207)
Esempio n. 2
0
 def test_swadesh_sanskrit(self):
     swadesh = Swadesh('sa')
     first_word = 'अहम्'
     match = swadesh.words()[0]
     self.assertEqual(first_word, match)
Esempio n. 3
0
import nltk
from nltk.tag import tnt
from nltk.corpus import indian
from cltk.corpus.swadesh import Swadesh
from cltk.stop.classical_hindi.stops import STOPS_LIST

def hindi_model():
    train_data = indian.tagged_sents('hindi.pos')
    tnt_pos_tagger = tnt.TnT()
    tnt_pos_tagger.train(train_data)
    return tnt_pos_tagger

print(STOPS_LIST[:5])
swadesh = Swadesh('hi')
print(swadesh.words()[:10])
hindi_text = 'सब छात्रों के लिए हिंदी व्याकरण से जुड़ी बहुत महत्वपूर्ण पुस्तक की तैयारी कर रहे है.'
hindi_text_tokenize = nltk.word_tokenize(hindi_text)
print(hindi_text_tokenize[0:10])
model = hindi_model()
print(model.tag(hindi_text_tokenize))

Esempio n. 4
0
 def test_swadesh_arabic(self):
     swadesh = Swadesh('ar')
     first_word = "أنا"
     match = swadesh.words()[0]
     self.assertEqual(first_word, match)
Esempio n. 5
0
 def test_swadesh_hindi(self):
     swadesh = Swadesh('hi')
     first_word = 'मैं'
     match = swadesh.words()[0]
     self.assertEqual(first_word, match)
Esempio n. 6
0
 def test_swadesh_old_portuguese(self):
     swadesh = Swadesh('pt_old')
     first_word = 'eu'
     match = swadesh.words()[0]
     self.assertEqual(first_word, match)
Esempio n. 7
0
 def test_swadesh_latin(self):
     swadesh = Swadesh('la')
     first_word = 'ego'
     match = swadesh.words()[0]
     self.assertEqual(first_word, match)
Esempio n. 8
0
 def test_swadesh_arabic(self):
     swadesh = Swadesh('ar')
     first_word = "أنا"
     match = swadesh.words()[0]
     self.assertEqual(first_word, match)
Esempio n. 9
0
 def test_swadesh_latin(self):
     swadesh = Swadesh("la")
     first_word = "ego"
     match = swadesh.words()[0]
     self.assertEqual(first_word, match)
Esempio n. 10
0
 def test_swadesh_greek(self):
     swadesh = Swadesh("gr")
     first_word = "ἐγώ"
     match = swadesh.words()[0]
     self.assertEqual(first_word, match)
Esempio n. 11
0
 def test_swadesh_old_norse(self):
     swadesh = Swadesh("old_norse")
     first_word = "ek"
     match = swadesh.words()[0]
     self.assertEqual(first_word, match)
Esempio n. 12
0
 def test_swadesh_old_english(self):
     swadesh = Swadesh("eng_old")
     first_word = "ic, iċċ, ih"
     match = swadesh.words()[0]
     self.assertEqual(first_word, match)
Esempio n. 13
0
 def test_swadesh_hindi(self):
     swadesh = Swadesh("hi")
     first_word = "मैं"
     match = swadesh.words()[0]
     self.assertEqual(first_word, match)
Esempio n. 14
0
 def test_swadesh_sanskrit(self):
     swadesh = Swadesh("sa")
     first_word = "अहम्"
     match = swadesh.words()[0]
     self.assertEqual(first_word, match)
Esempio n. 15
0
 def test_swadesh_old_portuguese(self):
     swadesh = Swadesh("pt_old")
     first_word = "eu"
     match = swadesh.words()[0]
     self.assertEqual(first_word, match)
Esempio n. 16
0
 def test_swadesh_hindi(self):
     swadesh = Swadesh('hi')
     first_word = 'मैं'
     match = swadesh.words()[0]
     self.assertEqual(first_word, match)
Esempio n. 17
0
 def test_swadesh_old_norse(self):
     swadesh = Swadesh('old_norse')
     first_word = 'ek'
     match = swadesh.words()[0]
     self.assertEqual(first_word, match)
Esempio n. 18
0
 def test_swadesh_tocharianB(self):
     swadesh = Swadesh("txb")
     first_word = "ñäś"
     match = swadesh.words()[0]
     self.assertEqual(first_word, match)
Esempio n. 19
0
 def test_swadesh_greek(self):
     swadesh = Swadesh('gr')
     first_word = 'ἐγώ'
     match = swadesh.words()[0]
     self.assertEqual(first_word, match)
Esempio n. 20
0
 def test_swadesh_hebrew(self):
     swadesh = Swadesh('hbo')
     first_word = '\'anî, \'ānokî '
     match = swadesh.words()[0]
     self.assertEqual(first_word, match)
Esempio n. 21
0
 def test_swadesh_tocharianB(self):
     swadesh = Swadesh('txb')
     first_word = 'ñäś'
     match = swadesh.words()[0]
     self.assertEqual(first_word, match)
Esempio n. 22
0
 def test_swadesh_greek(self):
     swadesh = Swadesh('gr')
     first_word = 'ἐγώ'
     match = swadesh.words()[0]
     self.assertEqual(first_word, match)
Esempio n. 23
0
 def test_swadesh_sanskrit(self):
     swadesh = Swadesh('sa')
     first_word = 'अहम्'
     match = swadesh.words()[0]
     self.assertEqual(first_word, match)
Esempio n. 24
0
 def test_swadesh_latin(self):
     swadesh = Swadesh('la')
     first_word = 'ego'
     match = swadesh.words()[0]
     self.assertEqual(first_word, match)
Esempio n. 25
0
 def test_swadesh_old_norse(self):
     swadesh = Swadesh('old_norse')
     first_word = 'ek'
     match = swadesh.words()[0]
     self.assertEqual(first_word, match)
Esempio n. 26
0
 def test_swadesh_tocharianB(self):
     swadesh = Swadesh('txb')
     first_word = 'ñäś'
     match = swadesh.words()[0]
     self.assertEqual(first_word, match)
Esempio n. 27
0
 def test_swadesh_old_english(self):
     swadesh = Swadesh('eng_old')
     first_word = 'ic, iċċ, ih'
     match = swadesh.words()[0]
     self.assertEqual(first_word, match)
Esempio n. 28
0
 def test_swadesh_old_portuguese(self):
     swadesh = Swadesh('pt_old')
     first_word = 'eu'
     match = swadesh.words()[0]
     self.assertEqual(first_word, match)