Skip to content

[Feature] Support normalization/placeholders during extraction to deduplicate near-identical strings #128

@michael-proulx

Description

@michael-proulx

Many pages differ only by numbers or small text (e.g., <title>Top news - Page 60 - My Blog</title>), but Rosey will generate a key for every pages.

[
  "key57": "Top news - Page 57 - My Blog",
  "key58": "Top news - Page 58 - My Blog",
  "key59": "Top news - Page 59 - My Blog",
  "key60": "Top news - Page 60 - My Blog",
  ...
]

It would be nice to be able to split that key into small re-usable chunk e.g.

  "key1": "Top news"
  "key2": "Page {{ n }}"
  "key3": "My Blog"

Supporting Custom Params, Regex or maybe re-use a Rosey key e.g.

<title data-rosey-regex="{"/Page\s+(\d+)/": "rosey.key2", "/My Blog/": "rosey.key3"}">
  Top news - Page 60 - My Blog
</title>

Those are suggestions, it doesn't cover every edge cases, if you got any other/better ideas.
Like in the case of my title we could split by -.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions