jp2en web services api collection
Project description
==========
jp-net-kit
==========
Collection of utilities, dedictated for consuming following services:
* MeCab;
* JDic;
* Kradfile
* Weblio;
* Jisho;
* Wordnet.
Example usage:
#!/usr/bin/env python
# encoding: utf-8
from jpnetkit.kradfile import Kradfile
from jpnetkit.jisho import Jisho
from jpnetkit.weblio import Weblio
from jpnetkit.mecab import MeCab
# our kanji
amusing_kanji = u'称'
# get radical decomposition
radicals = Kradfile().get_radikals_for(amusing_kanji)
# compile examples list with readings and translation
# for each of the word, that contains our kanji
examples = {}
weblio = Weblio()
mecab = MeCab()
jisho = Jisho()
for word in jisho.complete(amusing_kanji):
for sentence, translation in weblio.examples(word).iteritems():
examples[word] = {
'example': sentence,
'translation': translation,
'reading': mecab.get_reading(sentence),
}
jp-net-kit
==========
Collection of utilities, dedictated for consuming following services:
* MeCab;
* JDic;
* Kradfile
* Weblio;
* Jisho;
* Wordnet.
Example usage:
#!/usr/bin/env python
# encoding: utf-8
from jpnetkit.kradfile import Kradfile
from jpnetkit.jisho import Jisho
from jpnetkit.weblio import Weblio
from jpnetkit.mecab import MeCab
# our kanji
amusing_kanji = u'称'
# get radical decomposition
radicals = Kradfile().get_radikals_for(amusing_kanji)
# compile examples list with readings and translation
# for each of the word, that contains our kanji
examples = {}
weblio = Weblio()
mecab = MeCab()
jisho = Jisho()
for word in jisho.complete(amusing_kanji):
for sentence, translation in weblio.examples(word).iteritems():
examples[word] = {
'example': sentence,
'translation': translation,
'reading': mecab.get_reading(sentence),
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
jpNetKit-0.1dev.tar.gz
(9.4 kB
view hashes)