mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 01:37:39 +03:00
LibUnicode: Remove non-iterative text segmentation algorithms
They are now unused.
This commit is contained in:
parent
6ce7ec2eb3
commit
32a01a60e7
Notes:
sideshowbarker
2024-07-17 07:19:27 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/32a01a60e7 Pull-request: https://github.com/SerenityOS/serenity/pull/17483
@ -12,7 +12,6 @@
|
|||||||
#include <AK/IterationDecision.h>
|
#include <AK/IterationDecision.h>
|
||||||
#include <AK/Optional.h>
|
#include <AK/Optional.h>
|
||||||
#include <AK/Types.h>
|
#include <AK/Types.h>
|
||||||
#include <AK/Vector.h>
|
|
||||||
|
|
||||||
namespace Unicode {
|
namespace Unicode {
|
||||||
|
|
||||||
@ -22,19 +21,6 @@ void for_each_grapheme_segmentation_boundary(Utf8View const&, SegmentationCallba
|
|||||||
void for_each_grapheme_segmentation_boundary(Utf16View const&, SegmentationCallback);
|
void for_each_grapheme_segmentation_boundary(Utf16View const&, SegmentationCallback);
|
||||||
void for_each_grapheme_segmentation_boundary(Utf32View const&, SegmentationCallback);
|
void for_each_grapheme_segmentation_boundary(Utf32View const&, SegmentationCallback);
|
||||||
|
|
||||||
template<typename ViewType>
|
|
||||||
Vector<size_t> find_grapheme_segmentation_boundaries(ViewType const& view)
|
|
||||||
{
|
|
||||||
Vector<size_t> boundaries;
|
|
||||||
|
|
||||||
for_each_grapheme_segmentation_boundary(view, [&](auto boundary) {
|
|
||||||
boundaries.append(boundary);
|
|
||||||
return IterationDecision::Continue;
|
|
||||||
});
|
|
||||||
|
|
||||||
return boundaries;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename ViewType>
|
template<typename ViewType>
|
||||||
Optional<size_t> next_grapheme_segmentation_boundary(ViewType const& view, size_t index)
|
Optional<size_t> next_grapheme_segmentation_boundary(ViewType const& view, size_t index)
|
||||||
{
|
{
|
||||||
@ -73,19 +59,6 @@ void for_each_word_segmentation_boundary(Utf8View const&, SegmentationCallback);
|
|||||||
void for_each_word_segmentation_boundary(Utf16View const&, SegmentationCallback);
|
void for_each_word_segmentation_boundary(Utf16View const&, SegmentationCallback);
|
||||||
void for_each_word_segmentation_boundary(Utf32View const&, SegmentationCallback);
|
void for_each_word_segmentation_boundary(Utf32View const&, SegmentationCallback);
|
||||||
|
|
||||||
template<typename ViewType>
|
|
||||||
Vector<size_t> find_word_segmentation_boundaries(ViewType const& view)
|
|
||||||
{
|
|
||||||
Vector<size_t> boundaries;
|
|
||||||
|
|
||||||
for_each_word_segmentation_boundary(view, [&](auto boundary) {
|
|
||||||
boundaries.append(boundary);
|
|
||||||
return IterationDecision::Continue;
|
|
||||||
});
|
|
||||||
|
|
||||||
return boundaries;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename ViewType>
|
template<typename ViewType>
|
||||||
Optional<size_t> next_word_segmentation_boundary(ViewType const& view, size_t index)
|
Optional<size_t> next_word_segmentation_boundary(ViewType const& view, size_t index)
|
||||||
{
|
{
|
||||||
@ -124,19 +97,6 @@ void for_each_sentence_segmentation_boundary(Utf8View const&, SegmentationCallba
|
|||||||
void for_each_sentence_segmentation_boundary(Utf16View const&, SegmentationCallback);
|
void for_each_sentence_segmentation_boundary(Utf16View const&, SegmentationCallback);
|
||||||
void for_each_sentence_segmentation_boundary(Utf32View const&, SegmentationCallback);
|
void for_each_sentence_segmentation_boundary(Utf32View const&, SegmentationCallback);
|
||||||
|
|
||||||
template<typename ViewType>
|
|
||||||
Vector<size_t> find_sentence_segmentation_boundaries(ViewType const& view)
|
|
||||||
{
|
|
||||||
Vector<size_t> boundaries;
|
|
||||||
|
|
||||||
for_each_sentence_segmentation_boundary(view, [&](auto boundary) {
|
|
||||||
boundaries.append(boundary);
|
|
||||||
return IterationDecision::Continue;
|
|
||||||
});
|
|
||||||
|
|
||||||
return boundaries;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename ViewType>
|
template<typename ViewType>
|
||||||
Optional<size_t> next_sentence_segmentation_boundary(ViewType const& view, size_t index)
|
Optional<size_t> next_sentence_segmentation_boundary(ViewType const& view, size_t index)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user