summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'develop-next'HEADv0.14.1masterGravatar Sam Atman2025-07-0829-78713/+2325
|\
| * Add Words.zig example to READMEGravatar Sam Atman2025-07-084-27/+257
| |
| * Add graphemeAtIndex + iterate before and afterGravatar Sam Atman2025-06-014-87/+266
| | | | | | | | | | | | That completes the set. I do think it's possible to bum a few more cycles from the implementation, but, I'm not going to. It passes the acceptance suite and that's what it needs to do.
| * Document "fat_offset" in READMEGravatar Sam Atman2025-05-232-2/+23
| |
| * Make offset size configurableGravatar Sam Atman2025-05-235-48/+66
| | | | | | | | | | Hopefully I can talk users out of taking advantage of this configuration but I'll have better luck with that if it's available.
| * Add iterateBefore and iterateAfterGravatar Sam Atman2025-05-233-33/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | These create reverse or forward iterators before or after a Word. So this way, the user can get the word at an index, then iterate forward or back from that word. Also: Fixes #59 Which was fixed awhile back, but I don't feel like doing repo surgery to tag the fix where it happened. We have blame for that kind of thing.
| * Remove benchmarks, ziglyph referencesGravatar Sam Atman2025-05-1618-78501/+0
| | | | | | | | | | `ziglyph` is no longer maintained and basically abandoned, there's no need to keep the comparison between them active going forward.
| * Merge stranded README changes from v0.14 releaseGravatar Sam Atman2025-05-161-42/+42
| | | | | | | | Rebasing my way through that again was just not in the cards.
| * Words moduleGravatar Sam Atman2025-05-163-33/+33
| | | | | | | | | | | | In keeping with the new nomenclature, we're calling the module "Words", not "WordBreak". The latter is Unicode jargon, the module provides word iterators. Words are the figure, word breaks are the ground.
| * Move WordBreak to WordsGravatar Sam Atman2025-05-161-0/+0
| |
| * ProofreadGravatar Sam Atman2025-05-162-8/+9
| |
| * Merge Grapheme Segmentation Iterator TestsGravatar Sam Atman2025-05-151-79/+34
| |
| * Merge commit 'b5d955f' into develop-nextGravatar Sam Atman2025-05-153-3/+299
| |\
| | * Merge branch 'work-branch' into HEADGravatar Sam Atman2025-05-151-9/+46
| | |\
| | | * Various small iterator improvementswork-branchGravatar Sam Atman2025-05-131-9/+46
| | | |
| | * | feat: add reverse grapheme iteratorGravatar Matteo Romano2025-05-153-0/+296
| | | | | | | | | | | | | | | | Closes #53
| | * | fix: State.unset* did toggle the bit instead of unsetting itGravatar Matteo Romano2025-05-121-3/+3
| | |/
| | * Add reverse CodePoint iteratorGravatar Sam Atman2025-05-091-6/+75
| | |
| * | wordAtIndex passes conformanceGravatar Sam Atman2025-05-153-103/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | I removed the initAtIndex functions from the public vocabulary, because the last couple of days of sweat and blood prove that it's hard to use correctly. That's probably it for WordBreak, now to fix the overlong bug on v0.14 and get this integrated with the new reverse grapheme iterator.
| * | Rewrite wordAtIndex to use iterator flippingGravatar Sam Atman2025-05-151-24/+83
| | | | | | | | | | | | | | | | | | | | | This also adds helper functions for initializing iterators at an index within the string. Not that user code should do that necessarily, but `wordAtIndex` definitely should, and there's no reason not to make it available to others. With an appropriate warning at least.
| * | Add format for CodePointGravatar Sam Atman2025-05-151-2/+10
| | |
| * | Add reversal functions for word iteratorsGravatar Sam Atman2025-05-151-2/+81
| | | | | | | | | | | | | | | | | | While of only occasional use in real programs, one thing these are good for is reliably retrieving the word at a given index. Which turns out to be.. tricky is the best word.
| * | Peek tests for word iteratorsGravatar Sam Atman2025-05-151-0/+19
| | |
| * | ReverseWordIterator passes conformance testGravatar Sam Atman2025-05-151-19/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ended up needing a clone of the codepoint iterator, so that WB4 can ignore points in a matter compatible with backward search. So I created a special SneakIterator which can return WBPs directly, so as to skip ignorables. This is also needed for flag emoji, since the odd-number case must be handle immediately. So we count back in a WB4 compatible way, then store the count on the word iterator, and voila.
| * | Hooked up break test, some bugs squashedGravatar Sam Atman2025-05-153-34/+64
| | | | | | | | | | | | | | | The handling of ignorables is really different, because they 'adhere' to the future of the iteration, not the past.
| * | Reverse Word IteratorGravatar Sam Atman2025-05-152-1/+157
| | | | | | | | | | | | Next up I hook it to the tests.
| * | Add wordAtCursorGravatar Sam Atman2025-05-151-48/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is not actually the way to do it, and can break on some crafted strings. The way to actually do it: implement a reverse word search iterator, then do next() to find a word break, prev() to find a _valid_ word start, then next() again to find the valid end of said word. Maybe 2+, 2-, 1+ actually. I can probably write a test to see if the cursor spot is ambiguous, and apply an extra round if so. Need to mull the rules over before making any rash moves.
| * | Rewrite, passes WordBreakTestGravatar Sam Atman2025-05-153-78/+40
| | | | | | | | | | | | | | | After fixing a bug in Runicode which was fenceposting codepoints off the end of ranges. As one does.
| * | Begin conformance testGravatar Sam Atman2025-05-156-58/+362
| | | | | | | | | | | | | | | I'm not sure the details of this strategy can actually be made to work. But, something can.
| * | Implement Word iteratorGravatar Sam Atman2025-05-151-0/+228
| | | | | | | | | | | | | | | | | | | | | | | | | | | A by-the-book implmentation of the word break rules from tr29. This is superficially inefficient, but compilers are more than able to handle the common subexpression folding ignored by this approach. Now to port the WordBreakPropertyTests, and clean up the inevitable bugs in the implementation.
| * | Vastly simplify peek()Gravatar Sam Atman2025-05-151-60/+3
| | | | | | | | | | | | Idiomatic Zig takes awhile, what can I say (yes I wrote the first one).
| * | Refactor in unicode_testsGravatar Sam Atman2025-05-152-32/+53
| | | | | | | | | | | | | | | | | | | | | The comments in WordBreak and SentenceBreak tests get really long, the provided buffer would be inadequate. So this just provides a sub- iterator which will strip comments and comment lines, while keeping an eye on line numbers for any debugging.
| * | Add WordBreakPropertyDataGravatar Sam Atman2025-05-153-0/+276
| | | | | | | | | | | | Passes some simple lookup tests.
| * | Various small iterator improvementsGravatar Sam Atman2025-05-151-4/+51
| | |
| * | Add reverse CodePoint iteratorGravatar Sam Atman2025-05-151-1/+67
| | |
* | | Merge pull request 'Fix benchmarks' (#56) from jacobsandlund/zg:benchmarks ↵v0.14v0.14-betaGravatar atman2025-05-1611-177/+163
|\ \ \ | |/ / |/| | | | | | | | | | | | | | into v0.14-beta Reviewed-on: https://codeberg.org/atman/zg/pulls/56 Reviewed-by: atman <atman@noreply.codeberg.org>
| * | Fix benchmarksGravatar Jacob Sandlund2025-05-1611-177/+163
|/ /
* | Update README.mdv0.14.0-rc3Gravatar Sam Atman2025-05-151-0/+1
| | | | | | | | Fixes #55
* | Update NEWS.mdGravatar Sam Atman2025-05-151-26/+60
| |
* | Maximal Subparts testsGravatar Sam Atman2025-05-151-37/+114
| | | | | | | | | | The decoder now properly returns substitution bytes according to Substitution of Maximal Subparts, with tests to prove it.
* | Replace CodePoint Decoding with Hörhmann MethodGravatar Sam Atman2025-05-151-59/+204
| | | | | | | | | | | | | | | | This still needs a small barrage of tests to confirm that it correctly performs substitution of maximal subparts (Unicode 16.0.0 §3.9.6). I'm pretty sure this edition is 'overly maximal' actually, the name of the algorithm is somewhat misleading as to what it actually does.
* | Add overlong test, which should failGravatar Sam Atman2025-05-141-2/+15
|/ | | | But does not.
* Make DisplayWidth.setup publicv0.14.0-rc2Gravatar Sam Atman2025-05-041-1/+7
| | | | Also adds setupWithGraphemes variant.
* Remove inner setup from GeneralCategoriesGravatar Sam Atman2025-05-012-11/+2
| | | | | It was one `try` block away from only returning Allocator.Error, so now there's no need to filter errors in an outer `catch`.
* ProofreadsGravatar Sam Atman2025-05-011-1/+1
|
* ProofreadsGravatar Sam Atman2025-05-011-3/+3
|
* ProofreadsGravatar Sam Atman2025-05-011-1/+1
|
* ProofreadsGravatar Sam Atman2025-05-012-1/+6
|
* Version set for rc1v0.14.0-rc1Gravatar Sam Atman2025-05-012-2/+2
| | | | Closes #52
* Update CONTRIBUTORS.md, update build.zig.zonGravatar Sam Atman2025-04-306-311/+43
| | | | | Also replaces the obsolete HTML/CSS version of the Unicode License with the plain text version found on unicode.org.