An API to access online madura dictionary
Project description
madura_api
A Python API to access online madura dictionary
Usage
Install the package
pip3 install madura-api
Example 1
from madura_api import translate
result_list=translate('Home')
print(result_list)
result_list is a list of lists like this,
[
['n.', 'ආල'],
['n.', 'ආලය'],
['n.', 'උත්පත්ති ස්ථානය'],
['n.', 'උන්හිටි තැන'],
['n.', 'ගෘහය'],
['n.', 'ගෙදර'],
['a.', 'ගෙදර පිළිබඳ වූ'],
['vi.', 'ගෙදරට ආපසු පැමිණෙනවා'],
['n.', 'ගේ'],
['n.', 'ගේදොර'],
['n.', 'ඝර'],
['n.', 'නිවස'],
['n.', 'නිවහන'],
['n.', 'නිවාසය'],
['n.', 'නිවෙස'],
['Ele.', 'නිවෙසනවා'],
['Ele.', 'නිවෙසීම'],
['n.', 'පදිංචිය'],
['Soc.', 'පවුල'],
['Soc.', 'ස්වදේශ'],
['n.', 'සියරට']
]
Example 2
from madura_api import translate
result_list=translate('පොත')
print(result_list)
result_list is a list of lists like this,
[
['n.','bood'],
['n.', 'book'],
['n.', 'scroll']
]
- If there is no result, translate function will return False
Example 3
from madura_api import translate
result_list=translate('meen')
print(result_list)
False
Advanced Usage (Suggestions)
Example 4
This is how you translate something if you wanna work with suggestions
import madura_api
result=madura_api.Translate('home')
print(result.list)
[
['n.', 'ආල'],
['n.', 'ආලය'],
['n.', 'උත්පත්ති ස්ථානය'],
['n.', 'උන්හිටි තැන'],
['n.', 'ගෘහය'],
['n.', 'ගෙදර'],
['a.', 'ගෙදර පිළිබඳ වූ'],
['vi.', 'ගෙදරට ආපසු පැමිණෙනවා'],
['n.', 'ගේ'],
['n.', 'ගේදොර'],
['n.', 'ඝර'],
['n.', 'නිවස'],
['n.', 'නිවහන'],
['n.', 'නිවාසය'],
['n.', 'නිවෙස'],
['Ele.', 'නිවෙසනවා'],
['Ele.', 'නිවෙසීම'],
['n.', 'පදිංචිය'],
['Soc.', 'පවුල'],
['Soc.', 'ස්වදේශ'],
['n.', 'සියරට']
]
If you try to translate something that can't be translated it'll give you a suggestion list like this,
Example 5
import madura_api
result=madura_api.Translate('meen')
print(result.list)
[
'meed',
'meek',
'meekness',
'meerkat',
'meerschaum',
'meet',
'meeting',
'meeting adjourned',
'meeting annual general',
'meeting extraordinary'
]
But you will need to know if the output you get is a suggestion or not. This how you do that,
Example 6
import madura_api
result=madura_api.Translate('meen')
print(result.is_a_suggestion)
True
Miscellaneous Stuff
If you think madura_api is a pain in the ass to type, do this
import madura_api as mapi
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
madura_api-0.1.5.tar.gz
(15.6 kB
view hashes)
Built Distribution
madura_api-0.1.5-py3-none-any.whl
(15.8 kB
view hashes)
Close
Hashes for madura_api-0.1.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1326a6bca8929b164601af4d1ff7cb6d4b307a8e16bede4c72662b78a382963e |
|
MD5 | 545658d0929cc7b7e130048e2fd1920b |
|
BLAKE2b-256 | 297eb560849e89f50cdb8b96b2eeaaa4f53cfe3d42b867c4637957b2bfbe19a6 |