Skip to content

[[analyzer.filter]] in .toml file does not recognize suppress_tags = "True" #9

@purecod3

Description

@purecod3

Description

With config.toml file containing the below, tags are not suppressed.

[[analyzers]]
method = "ngram-word"
ngram = 2
    [[analyzers.filter]]
    type = "icu-tokenizer"
    suppress_tags = "True"

    [[analyzers.filter]]
    type = "lowercase"

Steps

>>> import metapy
>>> ana = metapy.analyzers.load('config.toml')
>>> doc = metapy.index.Document()
>>> doc.content("I said that I can't believe that it only costs $19.95!")
>>> print(ana.analyze(doc))
{'costs_$': 1, 'only_costs': 1, '$_19.95': 1, "i_can't": 1, 'i_said': 1, 'that_i': 1, 'believe_that': 1, '!_</s>': 1, 'said_that': 1, '19.95_!': 1, 'that_it': 1, '<s>_i': 1, "can't_believe": 1, 'it_only': 1}

Other

When using below in config.toml, filters are suppressed.

[[analyzers]]
method = "ngram-word"
ngram = 2
filter = [{type = "icu-tokenizer", suppress-tags = true}, {type = "lowercase"}]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions