Hello

it would be great to work without this <dfn>-tags
A term should be recognized automatically in a node body.

Is this already possible?

Thanks

Tobi

CommentFileSizeAuthor
#16 341890-15.patch31.17 KBfgm
#15 341890-14.patch13.56 KBfgm
#14 341890.patch6.61 KBfgm
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

fgm’s picture

Status: Active » Closed (works as designed)

No, this is something which has been ruled out from the module spec since its inception, because it does not work with large dictionaries, where common words would cause erroneous links to appear.

But you can find that feature in Glossary.module.

chawl’s picture

G2 may cooperate with the Glossify module I hope, as terms are nodes in fact.

http://drupal.org/project/glossify

clashar’s picture

but it would be really nice feature to avoid inserting every time tags manually.
It could be an option to search for terms everywhere or in specific tags, for example only for
div class="g2-search-area"

I need big dictionary for several thousands terms and Glossary would do it fast.

fgm’s picture

Status: Closed (works as designed) » Fixed

There is a discussion in the G2 docs about the design choices and respective features of Glossary and G2 at http://drupal.org/node/266511

Basically, the reason why there is no automatic linking in G2 is to allow dictionaries to contain short, common, words (like "a") without having tons of spurious links appearing on every page where the word appears.

In addition, such a system has a scaling problem as the number of entries increases, with the need to match a growing number of terms with each potential fragment. And since G2 is designed for large glossaries, load needs to be accounted for.

It's basically the same choice done in MediaWiki, DokuWiki and most wikis no longer to use CamelCase to automatically link, but require a wrapper element (typically some number of [] in wikis, and a DFN element in G2).

The D7 version is likely to include several linking methods, including an optional automatic link like the one you describe, but this will be off by default (for the reasons above), and not advised for medium and large glossaries.

(side note: when you want to comment on a closed issue, reset it to active, otherwise the maintainer won't be notified about your update)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

clashar’s picture

Status: Closed (fixed) » Active

fgm,

as I understand this feature seems to appear in D7.

Is it difficult to include/backport this feature not as default, but optionally for D6? in this way users who want to use words (like "a") could just use default settings.

fgm’s picture

Status: Active » Closed (won't fix)

The D7 version hasn't even been started yet, so there is nothing to backport. Unless someone wants to perform that backport once the D7 version is created and/or sponsor its creation, I very much doubt that there will be any new features like this added in the D6 version.

clashar’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Status: Closed (won't fix) » Active

fgm, you wrote

The D7 version is likely to include several linking methods, including an optional automatic link like the one you describe, but this will be off by default (for the reasons above), and not advised for medium and large glossaries.

could you please say if G2 for D7 has already this feature.

fgm’s picture

No, it does not, but it should get it at some point. See the "choosing" page at http://wiki.audean.com/g2/choosing : you are welcome to complete the chart if you have any information about the alternatives, by the way.

tomdisher’s picture

Hi fgm,

Thanks for all the work you've done on G2.

It looks like my specs are outside the capability of the original glossary module. We will have many definitions, so I don't want a solution with taxonomy.

G2 is exactly what I need - minus this one killer feature. Any idea when G2 could automatically link definitions, like the original glossary module?

Would this feature be backported to D6? I'm currently stuck on 6 for a few other modules.

Thanks again in advance!
Tom

fgm’s picture

Hi tom,

Actually, not having this auto-recognition, at the time G2 was designed, was a feature: it was voluntarily opted out, in favor or explicit links.

It is definitely back on the table for the hypothetical "refactoring" version of G2, but seeing how time flies, I have no idea when this eventually see the light of day. The only thing that seems reasonably certain is that if/when it appears for D7, I will not port it back to D6, which will be nearing end of life, seeing how most new projects during the last year have been on D7, not D6.

Unless someone else does the port or wants to sponsor it, of course. But in short, don't hold your breath: auto filtering is not coming for D6 from me any time soon.

fgm’s picture

Version: 7.x-1.x-dev » 8.x-1.x-dev
Issue summary: View changes

New features only in current dev version : bumping to 8.x.

fgm’s picture

The D10/D9 version, as of 8.x-1.0-alpha1, ships with a Definition filter plugin replicating the legacy hook_filter handling older versions used to have.

The way it has been designed is to support another Automatic filter plugin that will automatically (hence the name) identify words matching G2 entries and wrap them in a <dfn> element so that the Definition filter can then handle them.

The keys to solving the underlying issues are the discovery of Aho-Corasick (already implemented and tested in alpha1) and the idea of having a "stop list" to avoid matching G2 entries that could be false positives.

That way, when a term in the stop list still needs to be linked (as opposed to being a false positive), the author can still manually use a <dfn> element to generate the definition link, but it will not be automatically added.

fgm’s picture

Assigned: Unassigned » fgm
Status: Active » Needs review
FileSize
6.61 KB

First step: the base filter and its configuration.

fgm’s picture

FileSize
13.56 KB

Multi-pattern matcher and filter implemented. Need more integration testing.

fgm’s picture

FileSize
31.17 KB

Stop list handled, with different values per input format. Seems to be feature-complete.

  • fgm committed 63b960e6 on 8.x-1.x
    Issue #341890 by fgm: automatically wrap DFN around text maching entries
    
fgm’s picture

15 years later, merged to current dev HEAD. Thanks all.

fgm’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.