mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 21:47:45 +00:00
LibJS: Use iterative text segmentation algorithms for Intl.Segmenter
This uses the find-next and find-previous APIs instead of storing all indices as a vector.
This commit is contained in:
parent
9a7b3c145f
commit
7cb956d17b
5 changed files with 43 additions and 38 deletions
|
@ -24,8 +24,6 @@ public:
|
|||
|
||||
Utf16View segments_string() const { return m_segments_string.view(); }
|
||||
|
||||
Optional<Vector<size_t>>& boundaries_cache() const { return m_boundaries_cache; }
|
||||
|
||||
private:
|
||||
Segments(Realm&, Segmenter&, Utf16String);
|
||||
|
||||
|
@ -33,8 +31,6 @@ private:
|
|||
|
||||
Segmenter& m_segments_segmenter; // [[SegmentsSegmenter]]
|
||||
Utf16String m_segments_string; // [[SegmentsString]]
|
||||
|
||||
mutable Optional<Vector<size_t>> m_boundaries_cache;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue