Skip to content

Commit

Permalink
brought back older README with additional changes
Browse files Browse the repository at this point in the history
  • Loading branch information
hitblast committed Dec 9, 2024
1 parent 97bf8b0 commit 0e70102
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,52 +61,50 @@ This small tour guide will describe how you can use avro.py back and forth to op

#### 1. `parse()`

Let's assume I want to parse some English text to Bengali, which is "ami banglay gan gai.", so in this case to convert it to Bengali, we can use this starter code and follow along with the other examples to add further features:
Let's assume I want to parse some English text to Bengali, which is "ami banglay gan gai.", so in this case to convert it to Bengali, we can use this snippet as a starter code and then extend upon it as our boilerplate for multiple operations later on:

```python
import asyncio
# Import the package.
import avro

async def main() -> None:
dummy = 'ami banglay gan gai.'
# Our dummy text.
dummy = 'ami banglay gan gai.'

avro_output = await avro.parse(dummy)
print(output) # Output: আমি বাংলায় গান গাই।

if __name__ == '__main__':
asyncio.run(main())
# Parsing the text.
avro_output = avro.parse(dummy)
print(output) # Output: আমি বাংলায় গান গাই।
```

#### 2. `parse(bijoy=True)`

Alternatively, I can also do it in **Bijoy Keyboard format**:
Alternatively, I can also do it in Bijoy Keyboard format:

```python
bijoy_output = await avro.parse(dummy, bijoy=True) # Output: Avwg evsjvh় Mvb MvB।
bijoy_output = avro.parse(dummy, bijoy=True) # Output: Avwg evsjvh় Mvb MvB।
```

#### 3. `to_bijoy()`

Or, we can take the previous `avro_output` and convert it to Bijoy if we want to, like this:

```python
bijoy_text = await avro.to_bijoy(avro_output) # Output: Avwg evsjvh় Mvb MvB।
bijoy_text = avro.to_bijoy(avro_output) # Output: Avwg evsjvh় Mvb MvB।
```

#### 4. `to_unicode()`

Conversely, we can convert the Bijoy text we got just now and convert it back to Unicode Bengali:

```python
unicode_text = await avro.to_unicode(bijoy_text) # Output: আমি বাংলায় গান গাই।
unicode_text = avro.to_unicode(bijoy_text) # Output: আমি বাংলায় গান গাই।
```

#### 4. `reverse()`

Finally, we can just reverse back to the original text we passed as input in the first place:

```python
reversed_text = await avro.reverse(uncode_text) # Output: ami banglay gan gai.
reversed_text = avro.reverse(uncode_text) # Output: ami banglay gan gai.
```

<br>
Expand Down

0 comments on commit 0e70102

Please sign in to comment.