Repository navigation
3x performance, resolved memory allocation problem and correct handling of double-character codepoints - #16
Merged
thecoderok merged 10 commits intoSep 5, 2023
Conversation
…mentation that now gets called only for long input strings
…or the input string (length of input string * maximum needed lenght for a single char)
…map from a linked resource file
…equiring 2 consecutive c# chars)
Author
|
I went on coding and fixed issues #14 and #15 . To be precise now you can do these things: "xyz".Unidecode() // uses one of the two algorithms depending on the static property Unidecode.Algorithm
"xyz".Unidecode(UnidecodeAlgorithm.Fast); // uses the exact algorithm specified in the argument
Unidecode.Algorithm = UnidecodeAlgorithm.Complete; //sets the algoritm for the parameterless version to "complete"I also added a test case for the example provided in issue #15 these are the update benchmark results: |
Contributor
|
@csm101 Hi! I don't support this library anymore. I removed myself from repository. Try reach out repository owner - @thecoderok. |
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.
I added a benchmark to the solution (using BenchmarkDotNet).
these are the benchmark results in my modified branch:
and these are the result of the same banchmark when run on the original unmodified sources
I obtained this by implementing these modifications:
I also added an helper method that does the translation from indexes found in the decoded string to indexes in the original undecoded string.
I needed this method because I use unidecode for searching records that match a search string, but I need to visually highlight the matching occourrences in the original not "unidecoded" text. I think it might be useful also to other people, so I added it to Unidecoder.
the only thing that needs to be checked if it compiles for all the platform you want to support. I cared/checked only for net 7, honestly.