コード例 #1
0
ファイル: text_textblob.py プロジェクト: sichumon/pycheat
text = TextBlob(
    "One time there was this pycheat in github. And it was Github where all the cheats were"
)
text.word_counts['github']

#Translation
text = TextBlob("Frankly!Can I get a cup of coffe con leche in plaza Mayor?")
text.detect_language()
text.translate(to="es")

#Parsing

text.parse()

#Fetch words
text[0:7]

#Capital letters
text.upper()
text.lower()

#Find
text.find("leche")

#Get succesive words

text.ngrams(n=3)

#Get in json format

text.json()
コード例 #2
0
ファイル: test_blob.py プロジェクト: sbrosinski/TextBlob
 def test_upper(self):
     blob = TextBlob('lorem ipsum')
     assert_true(is_blob(blob.upper()))
     assert_equal(blob.upper(), TextBlob('LOREM IPSUM'))
コード例 #3
0
ファイル: test_blob.py プロジェクト: sbrosinski/TextBlob
 def test_upper_and_words(self):
     blob = TextBlob('beautiful is better')
     assert_equal(blob.upper().words, WordList(['BEAUTIFUL', 'IS', 'BETTER'
                  ]))
コード例 #4
0
ファイル: text_textblob.py プロジェクト: atassumer/pycheat
#Word counts
text = TextBlob("One time there was this pycheat in github. And it was Github where all the cheats were")
text.word_counts['github']

#Translation
text = TextBlob("Frankly!Can I get a cup of coffe con leche in plaza Mayor?")
text.detect_language()
text.translate( to="es")

#Parsing

text.parse()

#Fetch words
text[0:7]

#Capital letters
text.upper()
text.lower()

#Find
text.find("leche")

#Get succesive words

text.ngrams(n=3)

#Get in json format

text.json()