tno-terminology-design / tev2-tools

The Terminology Engine (v2) is a set of specifications and tools that caters for the creation and maintenance (i.e. curation) of terminologies. This repository contains the sources for the tools.
Apache License 2.0
2 stars 3 forks source link

MRGT - formPhrase processing - question/issue related to `term` #42

Closed RieksJ closed 7 months ago

RieksJ commented 8 months ago

@Ca5e The specificaitons say - and that is already implemented - that the MRGT processes the formPhrases field that it gets from curated texts before stuffing it into an MRG entry (which consists of processing the macros, pruning the results).

I am not sure whether we also agreed that the MRGT ensures that the formPhrases field in an MRG-entry would always contain the term itself - as specified in the term field of the curated text (and the corresponding MRG entry).

I would say that this helps in the processing of termrefs, as it would mean that the (regularized) showtext would only need to be compared to the various elements of the (regularized) elements in the formPhrases fields, rather than ALSO having to inspect the term field. Does that make sense?

I've updated the specs to that it states we do this. Would you please

Ca5e commented 8 months ago

The MRGT currently does not ensure that the form phrases in an MRG-entry always contains the term itself. It would simplify the lookup ever so slightly. Going from: matches = matches.filter((entry) => entry.term === term || entry.formPhrases?.includes(term)) to matches = matches.filter((entry) => entry.formPhrases?.includes(term)). (utils/MRG.ts)

I always saw the form phrases as aliases, but this changes that slightly. I don't mind the current approach (similar to aliases), because it means that formPhrases isn't always required to be present within an MRG entry.

RieksJ commented 8 months ago

I can see that there's not much performance gain. But that's not the reason for doing this. The reason is that it is much easier to explain, understand, and learn how TermRef resolution works if we can assume the term is always part of the formPhrases.

@Ca5e: If it's not that big a deal, can you implement this?

RieksJ commented 7 months ago

@Ca5e : I've modified the term writer so that it now has term: xriter. The formPhrases field says only contains "writer{ss}". So, for as long as this issue isn't fixed (which is currently the case), everything will still work, and the formPhrases field of the MRG entry (in the default MRG) for the term 'xriter' does not contain xriter as one of its formPhrase field elements.

As soon as it does, this issue can be closed.

RieksJ commented 7 months ago

And it does.