mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:37:34 +00:00
LibUnicode+LibJS: Move text segmentation algorithms to their own files
These algorithms are quite chonky, and more APIs around them are to be added, so let's move them to their own files for a bit of organization.
This commit is contained in:
parent
9ba3c8e36d
commit
2d487e4e4c
7 changed files with 439 additions and 401 deletions
23
Userland/Libraries/LibUnicode/Segmentation.h
Normal file
23
Userland/Libraries/LibUnicode/Segmentation.h
Normal file
|
@ -0,0 +1,23 @@
|
|||
/*
|
||||
* Copyright (c) 2022, Idan Horowitz <idan.horowitz@serenityos.org>
|
||||
* Copyright (c) 2023, Tim Flynn <trflynn89@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Forward.h>
|
||||
#include <AK/Types.h>
|
||||
#include <AK/Vector.h>
|
||||
|
||||
namespace Unicode {
|
||||
|
||||
Vector<size_t> find_grapheme_segmentation_boundaries(Utf16View const&);
|
||||
|
||||
Vector<size_t> find_word_segmentation_boundaries(Utf8View const&);
|
||||
Vector<size_t> find_word_segmentation_boundaries(Utf16View const&);
|
||||
|
||||
Vector<size_t> find_sentence_segmentation_boundaries(Utf16View const&);
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue