afs_lang_set - AFS - Reference Guides

AFS Filters Description

Product
AFS
Platform
7.11
Category
Reference Guides
Language
English

Set language of input documents

The filter is declared with the afs_lang_set type. It is in the antidot-paf package. It is a processor filter.

The Language setter filter specifications are described in the following table:

Parameter name

Mandatory

Type

Default

Description

xpath

No

string

Not defined

The XPath used on XML documents to extract lang-region codes or the language itself. If several langs are found by the given XPath, only the first one is used.

nsmap

No

map

Empty map

Namespaces used to interpret the given XPath.

jpath

No

string

Not defined

The JPath used on JSON documents to extract lang-region code or the language itself. If several langs are found by the given JPath, only the first one is used.

value

No

string

Not defined

Valid values are:
  • iso639-1 language code and optionally iso3166-1 country code,
  • language name in english,
  • language name in the language itself.

input_layer

No

layer

CONTENTS

Input layer used to determine the language of the document.

The language setter filter enables to set the language of the documents statically or extract the language directly from the content of the document (iso639-1 language code, language name in english or in the language itself). This is useful if documents to process should be dispatched by following switch in the PaF pipeline. You should provide at least one of the following parameters:
  • xpath: for XML documents,
  • jpath: for JSON documents,
  • value: iso639-1 language code and optionally iso3166-1 country code.
If the language can not be determined through xpath or jpath, the configured code is used. If no code is given, no language is set to the document.