View Source GoogleApi.ContentWarehouse.V1.Model.RepositoryWebrefLightweightTokensMatchedLightweightToken (google_api_content_warehouse v0.4.0)

Necessary information of lightweight token pattern with entity retrieval to pass to downstream clients. For example: FpTokenRange: normalized_text: "zurichben" language: Hungarian retrieved_entity: /m/08966 (with name "zurich") will get: MatchedLightweightToken: LightweightTokenType: "LOCATIVE" begin_offset: 6 end_offset: 9 pattern_id: 8141703461898598811 source_entity_index: 0 FpTokenRange: normalized_text: "egyesult allamokott" language: Hungarian retrieved_entity: /m/09c7w0 (with name "egyesult allamok") will get: MatchedLightweightToken: LightweightTokenType: "LOCATIVE" begin_offset: 16 end_offset: 19 pattern_id: 10449962977910715124 source_entity_index: 0 Note that begin_offset and end_offset marks the input byte range of the matched input text. For example, if the input text is [tannlegas] in Norwegian, this matches with the rewrite rule "e:as" to transform "tannlegas" to "tannlege". The matched byte range is [7, 9) on "as", therefore begin_offset = 7 and end_offset = 9. This must not be confused with the rewritten range [7, 8) on "e". Also, keep in mind these are byte offsets, not codepoints.

Attributes

  • additionalBeginOffset (type: integer(), default: nil) - The byte offset of the beging of the additional lightweight token match. e.g. the prefix pattern of the circumfix.
  • additionalEndOffset (type: integer(), default: nil) - The byte offset of the end of the additional lightweight token match. e.g. the suffix pattern of the circumfix.
  • beginOffset (type: integer(), default: nil) - The byte offset of the begin of the lightweight token match within each range. The default value of -1 (std::string::npos) means that there's no affix or adposition detected.
  • endOffset (type: integer(), default: nil) - The byte offset of the end of the lightweight token match within each range. The default value of 0 means that there's no affix or adposition detected.
  • patternId (type: String.t, default: nil) - Matched pattern Id which will be used to retrieve back pattern features. Pattern id is only populated for Enricher model.
  • sourceEntityIndex (type: integer(), default: nil) - The index of the source entity in the resulting WebrefEntities or WebrefEntitiesWrapper, to which the lightweight token rule is applied. This field is only populated at the end of Qref scorer when we are sure which source entity should output.
  • type (type: String.t, default: nil) - The type of the lightweight token match, which provides the semantic information.

Summary

Functions

Unwrap a decoded JSON object into its complex fields.

Types

@type t() ::
  %GoogleApi.ContentWarehouse.V1.Model.RepositoryWebrefLightweightTokensMatchedLightweightToken{
    additionalBeginOffset: integer() | nil,
    additionalEndOffset: integer() | nil,
    beginOffset: integer() | nil,
    endOffset: integer() | nil,
    patternId: String.t() | nil,
    sourceEntityIndex: integer() | nil,
    type: String.t() | nil
  }

Functions

@spec decode(struct(), keyword()) :: struct()

Unwrap a decoded JSON object into its complex fields.