Unicode to English literals - #7
Open
Uuttssaavv wants to merge 17 commits into
Open
Conversation
sarbagyastha
requested changes
Aug 29, 2022
sarbagyastha
left a comment
Owner
There was a problem hiding this comment.
Thank you for your contribution. I've added some comments please look into those.
Comment on lines
+230
to
+231
| print(NepaliUnicode.convert( | ||
| "sayau' thu''gaa fUlakaa haamii, euTai maalaa nepaalii")); |
Owner
There was a problem hiding this comment.
Please format the code and add a trailing comma.
| var splittedString = text.split(''); | ||
| var convertedString = <String>[]; | ||
| for (var i = 0; i < splittedString.length; i++) { | ||
| if (i < splittedString.length - 1 && splittedString[i + 1] == '\u094D') { |
Owner
There was a problem hiding this comment.
final <is?> = splittedString[i + 1] == '\u094D'; // give the variable name so that the check you're trying to perform becomes self-explanatory.| convertedString.add(fullStr); | ||
| } else if (splittedString[i] != '\u094D') { | ||
| convertedString | ||
| .add(_unicodeMap[splittedString[i]] ?? splittedString[i]); |
Owner
There was a problem hiding this comment.
please add missing trailing comma
| 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(); |
Owner
There was a problem hiding this comment.
What do you mean by fullStr here ?
Comment on lines
+29
to
+32
| 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); |
Owner
There was a problem hiding this comment.
convertedString[i - 1] is being repeated multiple times, please extract it a variable.
| 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')) { |
Owner
There was a problem hiding this comment.
Why was the check needed, please add a comment.
Comment on lines
+37
to
+38
| _text = convertedString.join(''); | ||
| return _text; |
sarbagyastha
requested changes
Aug 29, 2022
Comment on lines
+230
to
+233
| print(NepaliUnicode.convert( | ||
| "sayau' thu''gaa fUlakaa haamii, euTai maalaa nepaalii", | ||
| )); | ||
| // सयौं थुँगा फूलका हामी, एउटै माला नेपाली |
Owner
There was a problem hiding this comment.
still not properly formatted.
| ### Unicode to English iterals | ||
| Converts Nepali Unicode into English literals. | ||
| ```dart | ||
| print(NepaliUnicode.convert("सयौं थुँगा फूलका हामी, एउटै माला नेपाली")); |
Comment on lines
+33
to
+34
| preecedingCharacter = | ||
| preecedingCharacter.substring(0, preecedingCharacter.length - 1); |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Feature Request: Conversion from Nepali unicode to English Literals