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

ReDesign #51

Open
azu opened this issue Oct 27, 2020 · 0 comments
Open

ReDesign #51

azu opened this issue Oct 27, 2020 · 0 comments
Labels
Status: Proposal Request for comments

Comments

@azu
Copy link
Member

azu commented Oct 27, 2020

1 dictionary per 1 file limits portability.
This limitation comes from maintaincebility.

But, I think that maintaince can be possible even if one dictionary includes multiple items.
prh has not id like midashi-見出し.

We can introduce midashi for each item.
The format is almost same to currenct. It is just multiple items.

# `id` is unique string
-   id: ECMASCript
    # `description` is a short comment
    description: 'Reference https://www.ecma-international.org/publications/standards/Ecma-262.htm'
    # `expected` is expected result
    # `$1` ... `$9` reference `patterns`'s capture word
    # This is same behavior with RegExp https://github.com/zeeshanu/learn-regex 
    expected: ECMAScript $1
    # `patterns` are match string or RegExp
    # RegExp should be started with `/` and be ended with `/`
    # Also, can use `()` for capturing
    patterns:
      - /ECMAScript([0-9]+)/i
      - /ECMA Script([0-9]+)/i
    # `allows` define ignore patterns
    #  If `allows` pattern are matched, just ignore it
    allows:
      - ECMASCRIPT1
    # `specs` are test cases
    # `specs[n].from` is actual word
    # `specs[n].to` is expected word that is replaced result
    specs:
      - from: ECMASCRIPT5
        to: ECMAScript 5
      - from: ECMASCRIPT1
        to: ECMASCRIPT1 # because "ECMASCRIPT1" is allowed
    # `tags` are keywords
    # Some `tag` means special meaning
    tags:
      - noun
      - JavaScript

-   id: jQuery
    expected: jQuery
    patterns:
      - /jquery/i
    specs:
      - from: jquery
        to: jQuery

This ways's pros is easy to use.
Also, we can sort dictionary.

Per file approach has file name problem #44 .
This approach resolve it.

@azu azu added the Status: Proposal Request for comments label Oct 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Proposal Request for comments
Projects
None yet
Development

No branches or pull requests

1 participant