Skip to content

Extension of symbol mechanism #34

@andreasbaumann

Description

@andreasbaumann

In the following example:

WORD ^1 : /\b\p{L}+\b/;

KnownName = sequence_imm( firstName = "Hans" WORD, lastName = WORD );

Let's assume we have a list of known first names in a dictionary, so how can we make
sure we match exactly those as symbols in firstName?

The two options I can come up with, don't look too nice:

WORD ^1 : /\b\p{L}+\b/;

KnownName = sequence_imm( firstName = "Albert" WORD, lastName = WORD );
KnownName = sequence_imm( firstName = "Hans" WORD, lastName = WORD );
...
KnownName = sequence_imm( firstName = "Werner" WORD, lastName = WORD );

or even worse:

WORD ^1 : /\b\p{L}+\b/;
FIRST : /\b((Albert)|(Hans)|(Werner))\b/;

KnownName = sequence_imm( firstName = FIRST, lastName = WORD );

Allowing an API there and providing a dictionary for instance allows to filter for known
items.

I could also imagine an interface to a "SELECT first FROM known_customers" into a
database. Of course the question is, how far things should be done in the CLIs like
strusPatternMatcher and when you should use the APIs to do the filtering as a
subcomponent along to database and other processing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions