Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve position of TextType #280

Open
dishmint opened this issue Nov 8, 2023 · 1 comment
Open

Preserve position of TextType #280

dishmint opened this issue Nov 8, 2023 · 1 comment
Assignees
Labels
refactor Code refactor or improvement

Comments

@dishmint
Copy link
Owner

dishmint commented Nov 8, 2023

ContentAssociation[sourcetext_String, se_] :=

Currently, all instances of a text type will be merged into a single Alternatives. This is imprecise.

If I have LexicalPattern[TextType["Noun"]~~TextType["Verb"]~~TextType["Noun"]], the noun TTs in positions 1 and 3 will match the same set of nouns. A precise lexical pattern shouldn't work this way — each noun TT should only match nouns that actually occur in those positions. To make this work with the current implementation, it probably requires additional positional checks.

A successful TT match is one where the TT occurs in the same sequence position in the source text as it does in the lexical pattern.

The whole point of grabbing all TT instances first, is that the alternative is slow. Hopefully performing this check doesn't add too much overhead.

@dishmint dishmint self-assigned this Nov 8, 2023
@dishmint dishmint added refactor Code refactor or improvement lexical-pattern request New feature request and removed refactor Code refactor or improvement lexical-pattern labels Nov 8, 2023
@dishmint dishmint changed the title [Feature] Preserve position of TextType Preserve position of TextType Nov 8, 2023
@dishmint dishmint added refactor Code refactor or improvement and removed request New feature request investigate labels Nov 8, 2023
@dishmint
Copy link
Owner Author

dishmint commented May 5, 2024

Holding off on this one for now — I don't have an efficient design yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Code refactor or improvement
Projects
Status: Investigate
Development

No branches or pull requests

1 participant