Skip to content

Redesign speed-type-wordlist-transform to be used for all-commands #106

@lordnik22

Description

@lordnik22

With speed-type-pandoc depending on the website the user is converting he might want to filter certain annoying patterns. These patterns are specific to the structure of the website and the pandoc-conversion (which is a best effort conversion). It can get very specific, so the user knows best what patterns he might want to filter. Applying a general rule would be a overkill for other users.

An example what a user might want to filter are references on wikipedia-pages: ([3]).

The mechanism should also allow to skip whole sections and start where it get's interesting for the user.

For example wikipedia-pages come often we a big language-list at the start which needs to be skipped before the content starts. There is currently only the workaround to store manually an entry in the speed-type-statistic-filename which sets speed-type--continue-at-point to the desired continue-point.

Considering the above the new procedure should look something like: pick -> put-text-property -> filter -> replace -> trim -> pick -> put-text-property -> filter -> replace -> trim -> pick -> ... until enough typing-material is collected or end of buffer is reached.

The procedure and existing function (step by step):

  1. pick = speed-type--pick-continue-text-bounds
  2. put-text-property = speed-type--put-text-property-orig-pos
  3. filter -> [To be implemented]
  4. replace = speed-type--replace-map-adjust-properties
  5. Repeat
    Finally: trim = string-trim or speed-type--trim

This procedure should be used for all commands. If the custom-variable is nil the filter-step should be skipped (it should be behave as is). Therefore it's an opt-in feature. The custom filters should be formulated general enough to work for all commands (the filter-function should a some context-arguments (e.g. identifies the used command). So the individual custom-function decides if it filters something or not depending on the context.

It should be documented in detail how these filter-functions are expected and which context-arguments are provided. It should show some example cases for the context-arguments, when to use them and when to ignore them.

The content-buffer should stay untouched so continue-at-point doesn't get corrupted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions