Skip to content

Commit

Permalink
Added example to the README file
Browse files Browse the repository at this point in the history
  • Loading branch information
ndyashas committed Aug 20, 2020
1 parent 3083af1 commit 3faf7da
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,30 @@ $ cd Dhwani
$ pip install -r requirements.txt
$ pip install -e .
```
## Example
An example of converting from *English* to *Kannada* is shown here.
```python
# Import the main converter class
from dhwani import Converter

# Make a converter object. The first argument is the
# ISO 639-3 code of the source language, and the second
# argument is the ISO 639-3 code of the destination language.
converter = Converter('eng', 'kan')

src_string = "kannaDa"

# Use the 'convert' method of converter object to get the converter
# string back.
dest_string = converter.convert(src_string)

# Print the result
# Note that the display for standard output needs to support the unicode
# characters.
print(dest_string)

```

## Currently supported conversions
* English to Kannada
* English to Devnagari
Expand Down

0 comments on commit 3faf7da

Please sign in to comment.