-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
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
Labels
No labels