#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "components/spellcheck/renderer/spellcheck_worditerator.h"
#include <map>
#include <memory>
#include <string>
#include <string_view>
#include <utility>
#include "base/i18n/break_iterator.h"
#include "base/logging.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "components/spellcheck/renderer/spellcheck.h"
#include "third_party/icu/source/common/unicode/normlzr.h"
#include "third_party/icu/source/common/unicode/schriter.h"
#include "third_party/icu/source/common/unicode/uscript.h"
#include "third_party/icu/source/i18n/unicode/ulocdata.h"
SpellcheckCharAttribute::SpellcheckCharAttribute()
: … { … }
SpellcheckCharAttribute::~SpellcheckCharAttribute() { … }
void SpellcheckCharAttribute::SetDefaultLanguage(const std::string& language) { … }
bool SpellcheckCharAttribute::IsTextInSameScript(
const std::u16string& text) const { … }
std::u16string SpellcheckCharAttribute::GetRuleSet(
bool allow_contraction) const { … }
void SpellcheckCharAttribute::CreateRuleSets(const std::string& language) { … }
bool SpellcheckCharAttribute::OutputChar(UChar c,
std::u16string* output) const { … }
bool SpellcheckCharAttribute::OutputArabic(UChar c,
std::u16string* output) const { … }
bool SpellcheckCharAttribute::OutputHangul(UChar c,
std::u16string* output) const { … }
bool SpellcheckCharAttribute::OutputHebrew(UChar c,
std::u16string* output) const { … }
bool SpellcheckCharAttribute::OutputDefault(UChar c,
std::u16string* output) const { … }
SpellcheckWordIterator::SpellcheckWordIterator()
: … { … }
SpellcheckWordIterator::~SpellcheckWordIterator() { … }
bool SpellcheckWordIterator::Initialize(
const SpellcheckCharAttribute* attribute,
bool allow_contraction) { … }
bool SpellcheckWordIterator::IsInitialized() const { … }
bool SpellcheckWordIterator::SetText(std::u16string_view text) { … }
SpellcheckWordIterator::WordIteratorStatus SpellcheckWordIterator::GetNextWord(
std::u16string* word_string,
size_t* word_start,
size_t* word_length) { … }
void SpellcheckWordIterator::Reset() { … }
bool SpellcheckWordIterator::Normalize(size_t input_start,
size_t input_length,
std::u16string* output_string) const { … }