Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for React Native #73

Open
KyawSoeHein opened this issue Mar 29, 2021 · 4 comments
Open

Add support for React Native #73

KyawSoeHein opened this issue Mar 29, 2021 · 4 comments

Comments

@KyawSoeHein
Copy link

I am trying to use this library in react native.

When I run this library. I find this error.

simulator_screenshot_AEF12D4E-E3F5-491B-A8CE-A7EE4AD0A108

I declared atob as global.

@sven-oly
Copy link
Collaborator

I'm sorry that you are having problems with these. I do not know about react, but here's some code that you can use in a web page

<script src="https://ajax.googleapis.com/ajax/libs/myanmar-tools/1.2.1/zawgyi_detector.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/myanmar-tools/1.2.1/zawgyi_converter.min.js"></script>

Note that you can also download the files from the ajax.googleapis.com site if you wish

<script type="text/javascript"> const zawgyi_converter = new google_myanmar_tools.ZawgyiConverter(); const zawgyi_detector = new google_myanmar_tools.ZawgyiDetector(); Then you can use the converters on JavaScript text: var outText = zawgyi_converter.zawgyiToUnicode(text_in); var outText = zawgyi_converter.unicodeToZawgyi(text_in); And the detector: var zawgyi_score = zawgyi_detector.getZawgyiProbability(intext); // returns value between 0 and 1. I hope that this helps.
@KyawSoeHein
Copy link
Author

I think this is the problem with this library because I changed to an angular library which is the same purpose as this one and it is working fine. I will close this issue for now.

@sffc sffc changed the title Decoding, encoding error in javascript Apr 1, 2021
@sffc
Copy link
Collaborator

sffc commented Apr 1, 2021

This library hasn't been tested on React Native, so it makes sense if it's not working because a function like atob is unavailable. It would be great to get a PR that makes it work, ideally with a new GitHub Actions test!

@sffc sffc reopened this Apr 1, 2021
@KyawSoeHein
Copy link
Author

I will try to do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment