mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 15:45:25 +00:00
LibUnicode+LibWeb: Move should_continue_beyond_word helper in Segmenter
This commit is contained in:
committed by
Tim Ledbetter
parent
fb23fd328b
commit
46db0febf7
@@ -6,6 +6,7 @@
|
||||
|
||||
#include <AK/Utf16View.h>
|
||||
#include <AK/Utf32View.h>
|
||||
#include <LibUnicode/CharacterTypes.h>
|
||||
#include <LibUnicode/ICU.h>
|
||||
#include <LibUnicode/Locale.h>
|
||||
#include <LibUnicode/Segmenter.h>
|
||||
@@ -235,4 +236,13 @@ NonnullOwnPtr<Segmenter> Segmenter::create(StringView locale, SegmenterGranulari
|
||||
return make<SegmenterImpl>(segmenter.release_nonnull(), segmenter_granularity);
|
||||
}
|
||||
|
||||
bool Segmenter::should_continue_beyond_word(Utf8View const& word)
|
||||
{
|
||||
for (auto code_point : word) {
|
||||
if (!code_point_has_punctuation_general_category(code_point) && !code_point_has_separator_general_category(code_point))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user