Open
Conversation
Member
|
Thanks. Looks very interesting! Did you accidentally commit some duplicated files? |
Author
|
the unicode (lib/unicode) part is currently separated from the original Re code (lib/). |
Author
|
I have tried to check the gap to be compliant with the Unicode® Technical Standard 18 - Unicode Regular Expressions.
|
…ries as per UTS ocaml#18 - Unicode Regular Expressions
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.
1st proposal to add Unicode support in the continuation of #48 to address #24
Currently utf8, utf16be, utf16le and Latin1 (backward compatibility) are supported but others can be build with respect to the interface Uucodecs.T.
Note that:
Basically everything is kept from the original except that this is heavily functor based:
The unicode categories (digit, alpha, alphanum, xdigit, ..) are generated during the building stage (currently shall be thoroughly checked and corrected - 1st attempt) with the help of uucd & uucp.
Butthe library itselfdoes not relyrelies on uucp:the case insensitive implementation in unicode/cset.ml is currently wrong. I left it aside at the beginning, but it looks more complex to implement than I thought: https://www.unicode.org/versions/Unicode16.0.0/core-spec/chapter-3/#G33992 and https://www.unicode.org/Public/16.0.0/ucd/CaseFolding.txt With the current type Cset.t, I think that we can only implement a simple case folding (C + S in the latter link) but not a (C + F). A full case folding would require to map one Uchar.t to a sequence of 1, 2 or 3 Uchar.t.The case insensitivity is implemented with the property simple_case_folding of the uucd lib. As per https://www.unicode.org/Public/17.0.0/ucd/CaseFolding.txt:Any comment is welcome!
Here after the results of the benchmarks with the original lib and the modified one
$_build/default/benchmarks/benchmark.exe
$ _build/default/benchmarks/unicode/benchmark_unicode.exe
$ _build/default/benchmarks/unicode/benchmark_unicode.exe