-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated examples and finalized markdown
- Loading branch information
Showing
3 changed files
with
45 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Imports. | ||
import avro | ||
|
||
|
||
# Please follow the detailed guidelines given in the README.md file about each function to learn more. | ||
def main() -> None: | ||
dummy_text = "amar sOnar bangla" # Dummy text. | ||
print("Original English Text:", dummy_text) | ||
|
||
parsed_text = avro.parse(dummy_text) # Parse the text to Bengali. | ||
print("Parsed Unicode Output:", parsed_text) | ||
|
||
# We can parse it directly to Bijoy, or use the to_bijoy function to convert it. | ||
# Both should return the same result. | ||
bijoy_text_direct = avro.parse(dummy_text, bijoy=True) | ||
bijoy_text_function = avro.to_bijoy(parsed_text) | ||
|
||
if bijoy_text_direct == bijoy_text_function: | ||
print(f"Bijoy Output: {bijoy_text_direct}") | ||
|
||
# Now, we can return the Bijoy text to Unicode since we'd like the original output (assuming). | ||
# This should be the same as the old parsed_text variable. | ||
unicode_text = avro.to_unicode(bijoy_text_direct) | ||
print("Reversed Unicode Output:", unicode_text) | ||
|
||
# Finally, we can reverse the Bengali text, back to English! | ||
reversed = avro.reverse(unicode_text) | ||
print("Reversed English Output:", reversed) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |