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

Support for abbreviations not implemented #1

Closed
fletcher opened this issue Feb 9, 2017 · 6 comments
Closed

Support for abbreviations not implemented #1

fletcher opened this issue Feb 9, 2017 · 6 comments
Assignees
Milestone

Comments

@fletcher
Copy link
Owner

fletcher commented Feb 9, 2017

Abbreviation support is not available yet. I'm not sure the best way to implement it, as it will need a slightly different approach than in MMD-5

@fletcher fletcher self-assigned this Feb 9, 2017
@fletcher fletcher added this to the 6.0 milestone Feb 9, 2017
@fletcher fletcher added bug core and removed bug labels Feb 9, 2017
@fletcher fletcher modified the milestones: 0.2, 6.0 Feb 9, 2017
@fletcher fletcher added this to TODO in Release MMD 6.0 Feb 9, 2017
@fletcher
Copy link
Owner Author

I'm not entirely dissatisfied with the way abbreviations work in MMD-5, however the algorithm to replace them will need to be modified. There are two general options:

  1. Read the document to find all abbreviation definitions, then scan the document for all uses of the abbreviation, and replace it with the appropriate syntax. Advantage -- automatically identifies all uses of the abbreviation without user action. Disadvantage -- requires scanning the entire document for each occurrence of each defined abbreviation. In MMD-5, this meant that 10 abbreviations would require scanning almost every word of the document 10 times. I've now worked on some code that could check for all 10 abbreviations in a single pass, but would still be a bit messy.

  2. Require the author to "tag" each use of the abbreviation that they desire to be handled. Each abbreviation would still only have to be defined once, but this would require more effort when writing or revising the document. Advantage -- much more efficient, since abbreviations would be identified during the usual parse process, just like links and footnotes. Disadvantage -- it becomes possible for an author to forget to take some uses of an abbreviation.

I welcome thoughts and input on this feature!

@fletcher fletcher moved this from TODO for Next Milestone to On Deck in Release MMD 6.0 Feb 11, 2017
@nemesit
Copy link

nemesit commented Feb 13, 2017

I think the single pass scan beats option 2.

@fletcher fletcher modified the milestones: 6.0, 0.2 Feb 14, 2017
@fletcher fletcher moved this from On Deck to In Progress in Release MMD 6.0 Mar 2, 2017
@fletcher
Copy link
Owner Author

fletcher commented Mar 2, 2017

As I think about this (and after re-implementing glossary support), I think that I will do a few things re: abbreviations:

  1. The syntax will fall more in line with footnotes, citations, and now abbreviations -- something along the lines of the [xfoo] where x is some punctuation character.

  2. The approach used for glossary items that requires tagging each use makes a lot of sense from a performance standpoint. Comparing each word in the document to an abbreviation list is expensive. And, because of the way MMD-6 is optimized for performance, it is a bit tricky.

  3. What might make sense for automated identification of abbreviations within the text would be a separate (optional) stage that takes the identified list of abbreviations and automatically wraps each instance in the [xfoo] syntax before re-processing the document.

  4. For those wanting "easy" -- give MMD a bit more time, and it will automatically identify each occurrence of abbreviations (and glossary terms?). If you need performance -- then each instance should be marked in advance, and MMD will use it's normal fast approach.

@fletcher fletcher moved this from In Progress to Almost done in Release MMD 6.0 Mar 5, 2017
@fletcher fletcher moved this from Almost done to Completed in Release MMD 6.0 Mar 5, 2017
@fletcher
Copy link
Owner Author

fletcher commented Mar 5, 2017

I think the new abbreviation syntax is better than the old one. There may still be room for some improvement.

See https://github.com/fletcher/MultiMarkdown-6/wiki/Changes-from-MMD-5 for more information.

@fletcher fletcher closed this as completed Mar 5, 2017
@fletcher fletcher removed this from Completed in Release MMD 6.0 Mar 5, 2017
@mn4367
Copy link

mn4367 commented Mar 9, 2017

The new syntax is nice but I'd like to vote for some sort of compatibility mode (command line switch, metadata key) which enables automatic identification of abbreviation and glossary terms. I'd happily accept the performance penalty.

@fletcher
Copy link
Owner Author

That was always on the list, and has been added this evening. Abbreviations and glossary terms are now automatically identified.

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

No branches or pull requests

3 participants