-
Notifications
You must be signed in to change notification settings - Fork 24
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
Unicode to English literals #7
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution. I've added some comments please look into those.
README.md
Outdated
print(NepaliUnicode.convert( | ||
"sayau' thu''gaa fUlakaa haamii, euTai maalaa nepaalii")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please format the code and add a trailing comma.
lib/src/unicode_to_english.dart
Outdated
var splittedString = text.split(''); | ||
var convertedString = <String>[]; | ||
for (var i = 0; i < splittedString.length; i++) { | ||
if (i < splittedString.length - 1 && splittedString[i + 1] == '\u094D') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
final <is?> = splittedString[i + 1] == '\u094D'; // give the variable name so that the check you're trying to perform becomes self-explanatory.
lib/src/unicode_to_english.dart
Outdated
convertedString.add(fullStr); | ||
} else if (splittedString[i] != '\u094D') { | ||
convertedString | ||
.add(_unicodeMap[splittedString[i]] ?? splittedString[i]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add missing trailing comma
lib/src/unicode_to_english.dart
Outdated
var convertedString = <String>[]; | ||
for (var i = 0; i < splittedString.length; i++) { | ||
if (i < splittedString.length - 1 && splittedString[i + 1] == '\u094D') { | ||
var fullStr = _unicodeMap[splittedString[i]].toString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean by fullStr
here ?
lib/src/unicode_to_english.dart
Outdated
convertedString[i - 1] = convertedString[i - 1].toString(); | ||
if (convertedString[i - 1].endsWith('a')) { | ||
convertedString[i - 1] = convertedString[i - 1] | ||
.substring(0, convertedString[i - 1].length - 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
convertedString[i - 1]
is being repeated multiple times, please extract it a variable.
lib/src/unicode_to_english.dart
Outdated
for (var i = 0; i < convertedString.length; i++) { | ||
if (_symbolMap[convertedString[i]] != null) { | ||
convertedString[i - 1] = convertedString[i - 1].toString(); | ||
if (convertedString[i - 1].endsWith('a')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was the check needed, please add a comment.
lib/src/unicode_to_english.dart
Outdated
_text = convertedString.join(''); | ||
return _text; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be return directly.
README.md
Outdated
print(NepaliUnicode.convert( | ||
"sayau' thu''gaa fUlakaa haamii, euTai maalaa nepaalii", | ||
)); | ||
// सयौं थुँगा फूलका हामी, एउटै माला नेपाली |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still not properly formatted.
### Unicode to English iterals | ||
Converts Nepali Unicode into English literals. | ||
```dart | ||
print(NepaliUnicode.convert("सयौं थुँगा फूलका हामी, एउटै माला नेपाली")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this correct ?
preecedingCharacter = | ||
preecedingCharacter.substring(0, preecedingCharacter.length - 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is this used ?
Feature Request: Conversion from Nepali unicode to English Literals