TIMEX
TIMEX

Reputation: 272134

How do I use this Python package? (guess_language)

I am trying to use this package: http://pypi.python.org/pypi/guess-language/0.1 I've read the documentation/wiki, but can't find the solution.

Basically, this package allows you to pass in a string, and it will return a "language". I'm able to make it print out "en".

htmlSource = download('http://feeds.feedburner.com/nchild')
soup = BeautifulStoneSoup(htmlSource)
justwords = ''.join(soup.findAll(text=True))
justwords = justwords.encode('utf-8')
true_lang =  guess_language.guessLanguage(justwords)

I'd like to know...how does this person print out the scores/accuracy of the guess?

Am I passing the string correctly to the python library?

Upvotes: 0

Views: 531

Answers (1)

Will McCutchen
Will McCutchen

Reputation: 13117

By modifying the source code of the module, from the sounds of this quote (taken from the answer you linked to):

Update after some experimentation, including inserting a print statement to show what script blocks were detected with what percentages

(Emphasis added by me.)

Upvotes: 1

Related Questions