#include "components/autofill/core/browser/form_parsing/address_field_parser_ng.h"
#include <initializer_list>
#include <ostream>
#include <string_view>
#include "base/types/cxx23_to_underlying.h"
#include "components/autofill/core/browser/autofill_field.h"
#include "components/autofill/core/browser/data_model/autofill_i18n_api.h"
#include "components/autofill/core/browser/field_types.h"
#include "components/autofill/core/browser/form_parsing/autofill_scanner.h"
namespace autofill {
namespace {
constexpr FieldType kAddressLines[] = …;
constexpr FieldTypeSet kAddressLinesFieldTypeSet({ … });
MatchParams MatchParamsWithFieldType(MatchParams p,
FormControlType field_type) { … }
MatchParams MatchParamsWithoutAttribute(MatchParams p,
MatchAttribute attribute) { … }
std::string SequenceToScoreString(const ClassifiedFieldSequence& sequence) { … }
}
class AddressFieldParserNG::FieldTypeInformation { … };
AddressFieldParserNG::FieldTypeInformation::FieldTypeInformation(
AddressCountryCode country_code)
: … { … }
AddressFieldParserNG::FieldTypeInformation::~FieldTypeInformation() = default;
void AddressFieldParserNG::FieldTypeInformation::
InitializeFieldTypesAndDescendants(AddressComponent* node) { … }
void AddressFieldParserNG::FieldTypeInformation::InitializeIncompatibilities() { … }
std::ostream& operator<<(
std::ostream& os,
const AddressFieldParserNG::FieldTypeInformation& field_types) { … }
ClassifiedFieldSequence::ClassifiedFieldSequence() = default;
ClassifiedFieldSequence::~ClassifiedFieldSequence() = default;
bool ClassifiedFieldSequence::BetterThan(
const ClassifiedFieldSequence& other) const { … }
AddressFieldParserNG::AddressFieldParserNG(AddressCountryCode client_country)
: … { … }
AddressFieldParserNG::~AddressFieldParserNG() = default;
std::unique_ptr<FormFieldParser> AddressFieldParserNG::Parse(
ParsingContext& context,
AutofillScanner* scanner) { … }
void AddressFieldParserNG::AddClassifications(
FieldCandidatesMap& field_candidates) const { … }
base::span<const MatchPatternRef> AddressFieldParserNG::GetMatchPatterns(
std::string_view name) { … }
std::optional<double> AddressFieldParserNG::FindScoreOfBestMatchingRule(
FieldType field_type) { … }
void AddressFieldParserNG::ParseRecursively() { … }
bool AddressFieldParserNG::IsClassificationPlausible() const { … }
}