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

Term of other terms — howto? #222

Open
filippoff opened this issue Sep 1, 2024 · 2 comments
Open

Term of other terms — howto? #222

filippoff opened this issue Sep 1, 2024 · 2 comments
Assignees
Labels

Comments

@filippoff
Copy link

filippoff commented Sep 1, 2024

Hi! I started using this great and useful extension and came across this situation.
I have a term that consists of other terms. For example, "Printed Circuit Boards".
I have in my Glossary three terms: "Printed Circuit Boards", "Circuit", "Boards". If the full term is found on the page, it is always parsed and gives two links to two short terms, "Printed Circuit Boards".
The full term ("Printed Circuit Board") - never. Is there any way to configure this? Is this a bug or a feature? :)
This seems to me to be an incorrect behavior of the parser.
I thought that setting plugin.tx_dpnglossary.settings.parsingSpecialWrapCharacters would help tell the parser which term to choose but it didn't help.

@featdd
Copy link
Owner

featdd commented Sep 1, 2024

Hi @filippoff,

currently terms for the parser get sortet by their length, so the smallest terms get matched first, this was intended at some point.
This is hardcoded by now, but I would agree to make this behaviour configurable, so you can choose this by yourself.

Give me some time to adjust this.

Greetings
Daniel

@featdd featdd self-assigned this Sep 1, 2024
@featdd featdd added the FEATURE label Sep 1, 2024
@filippoff
Copy link
Author

filippoff commented Sep 1, 2024

Thanks for the answer! so it's not a matter of settings. Now it's clear where to look. Implementation in the extension would be great, but on the current project I found a customized old version due to php7.4. I'll try to change the sorting order.

At the moment, for the experiment, I inverted the calculation of $sortingCallback in the findByNameLength() function (/Classes/Domain/Repository/AbstractTermRepository.php) and suddenly it turned out that I also have the term "Printed Circuit" :) Now I have "Printed Circuit Boards", but again not "Printed Circuit Boards". 5 terms for 3 words, huh.

upd.
Basically, I set up the output I needed. It turned out that the terms also have synonyms, the order of which in the list matters.

The ideal case is to be able to choose how exactly to parse the term in each case - completely or word by word, but how can this be implemented simply for the editor? Perhaps enclosing the term in quotation marks will help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants