Home arrow Forum

Remository Forum

 


stmatth

Karma: 1  
Plugin: More flexible terms - 2009/03/27 17:42 Hi, this is a great component and plugin, thanks. There are a few issues that makes the Glossary Definitions Plugin (and I guess the Glossarbot too) very limited, and I'm really having problems using it for my purposes. It would be great if you can improve it.

This has all to do with the flexibility that often a term doesn't appear the same way in the text as in the glossary, so the glossarbot doesn't find it or messes up.

I give you some real life examples:


  • "fMRI", "fMRT", "functional magnetic resonance imaging", "functional MRI" etc. are synonyms and can all appear in a text, but should lead to the same entry

  • "MRI" is something different than "functional MRI"

  • a BOLD response is, in medicine, a "blood oxygen level dependent" response. So "BOLD" in the context "fMRI measures a BOLD response" should give a popup for "blood oxygenated... (BOLD)", but "bold" in the context "scientists made a bold response to the threat of funding cuts" should not.

  • a word may not appear in the text explicitly, for example in "these are symptoms of the common cold" the "cold" should go to "influenza" (but of course not every occurrence of coled, see previous point)

  • especially in languages like German or French, there can be many different forms that a word appears, and they are not covered by the option to use only the beginning of a word. For example, "grippaler Infekt", "(dem) grippalen Infekt", "grippale Infekte" etc. are all the same.



So we need ways for fine tuning, both in the glossary itself and in individual articles.

  1. In the glossary, it should be possible to definine common alternatives and variants

  2. In the text, it should be possible to have markup that tells the glossarbot to:

      [li]ignore an individual word (e.g. "bold" in the example above)
    • use a different term than what is in the text (e.g. use influenza instead of cold)


    [/li]


It would be great if you can implement these. I assume that the last one (additional markup in the text) would not be too difficult.

I'm using Glossary 2.64 and the Definitions Plugin 1.1.10, both updated today. I'm not sure if the Glossarbot is different but I've tried it a few months ago and it didn't do this either.
Stephan Matthiesen - Science-Texts: editorial team for scientific texts
  | | Sorry, you do not currently have permission to write here.
admin

Karma: 98  
Re:Plugin: More flexible terms - 2009/04/04 11:58 Very good points. You're talking about features that would make Glossary and the related plugin a lot more complicated - quite a bit of development would be required. Not just code, but specification is difficult for the issues raised, as Glossary is used with a wide range of languages. Problems arise, such as the fact that not all languages use the notion of upper and lower case.

There is also a lurking problem which is performance. Ideally glossary processing would happen after a text is edited, and done only once. The framework for doing this does not exist in current CMS implementations, since the processing would require the saving of both before and after versions of the text. With glossary processing done on the fly, there is a limit on glossary size, maybe around 10,000 terms, after which the highlighting operation is not feasible. Adding in alternative terms would reduce the feasible size of glossary that could be handled.

So it's a bundle of issues that I'd be happy to discuss, but for which I cannot offer a simple solution!
Martin Brampton aka Counterpoint
http://aliro.org
http://black-sheep-research.com
  | | Sorry, you do not currently have permission to write here.
stmatth

Karma: 1  
Re:Plugin: More flexible terms - 2009/04/04 12:35 Hello Martin,

thanks for the reply, I can see your points.

But perhaps it would be possible to add some functionality for manual tweaking within the article source? So, for example, you can write in the article
symptoms of the {gloss:influenza:common cold}and then the text will read "symptoms of the common cold" but it links to the glossary entry for "influenza"?

This wouldn't have the problem with computational overhead as it still only needs to search for the one standard glossary term.

Would this be difficult to implement? It would simply require that the bot also recognizes this markup in addition to the pure term. I don't know the code well, but when I had a quick look earlier, and I think it converts glossary terms to something of a similar form anyway.

This would add a lot of flexibility.

Cheers
Stephan
Stephan Matthiesen - Science-Texts: editorial team for scientific texts
  | | Sorry, you do not currently have permission to write here.
stmatth

Karma: 1  
Re:Plugin: More flexible terms - 2009/04/11 10:01 Hi again,

I'd still like to be able to use a markup in the text to force definitionbot to show a term.

I want the following: If you put {ShowDefinition:termome text} into the article, then the bot should make a popup over "some text" with the definition of "term"

Looking at the code, internally it already uses a markup of the form {ShowDefinition:id:term} before replacing this by the actual popup. So I think it would be easy to do. Unfortunately I'm not very familiar with php and don't have time to experiment how to define the replacement rule.

Here is the issue:

In definitionbot.php, line 94 is:
Code:

 $newcontent preg_replace($entry['regex'],"$1{ShowDefinition:$id:$2}$3",$content,$times);



What we need is another line that does the following replacement:
Code:

 {ShowDefinition:term:some text} -> {ShowDefinition:id:some text}



How?

Cheers
Stephan

Post edited by: stmatth, at: 2009/04/11 10:02
Stephan Matthiesen - Science-Texts: editorial team for scientific texts
  | | Sorry, you do not currently have permission to write here.
stmatth

Karma: 1  
Re:Plugin: More flexible terms - 2009/04/24 01:02 Hi,

replace line 98 in definitionbot by the following two lines:

Code:

  $newcontent_temp preg_replace("/{Def:".$entry['term'].":(.*)}/","{ShowDefinition:$id:$1}",$content,$times); $newcontent preg_replace($entry['regex'],"$1{ShowDefinition:$id:$2}$3",$newcontent_temp,$times);



With this change, it is now possible to use markup in the text like {Def:term: some other text} which will keep "some other text" but make a popup with "term". This gives us more flexibility. It will still replace the occurrance of a term without any markup, so it's an additional feature.

Hope people find this useful. I'd appreciate if this change could be included in future versions.

Cheers
Stephan

Post edited by: stmatth, at: 2009/04/24 01:04

Post edited by: stmatth, at: 2010/03/29 10:41
Stephan Matthiesen - Science-Texts: editorial team for scientific texts
  | | Sorry, you do not currently have permission to write here.

Login

Subscribe to Premium Support

Get priority support for Remository and Glossary, sign up now for a Premium Support monthly subscription:

Your Remository user name

Or purchase a year's support:

Your Remository user name

Recommended SEF

SEF Advance

Who is Online

Remository welcomes guests and visitors

We have 10 guest online