项目作者: proofdict

项目描述 :
Proofdict mono repository.
高级语言: TypeScript
项目地址: git://github.com/proofdict/proofdict.git
创建时间: 2017-08-12T06:36:57Z
项目社区:https://github.com/proofdict/proofdict

开源协议:MIT License

下载


Proofdict Actions Status: test

Proofdict is a collection of dictionary.

Website

See website for using it.

Integration textlint

Use textlint-rule-proofdict

Proofdict format

  1. # `id` is unique string
  2. id: 01BQ92YYBEFBXEHH8T8HC8RCRD
  3. # `description` is a short comment
  4. description: 'Reference https://www.ecma-international.org/publications/standards/Ecma-262.htm'
  5. # `expected` is expected result
  6. # `$1` ... `$9` reference `patterns`'s capture word
  7. # This is same behavior with RegExp https://github.com/zeeshanu/learn-regex
  8. expected: ECMAScript $1
  9. # `patterns` are match string or RegExp
  10. # RegExp should be started with `/` and be ended with `/`
  11. # Also, can use `()` for capturing
  12. patterns:
  13. - /ECMAScript([0-9]+)/i
  14. - /ECMA Script([0-9]+)/i
  15. # `allows` define ignore patterns
  16. # If `allows` pattern are matched, just ignore it
  17. allows:
  18. - ECMASCRIPT1
  19. # `specs` are test cases
  20. # `specs[n].from` is actual word
  21. # `specs[n].to` is expected word that is replaced result
  22. specs:
  23. - from: ECMASCRIPT5
  24. to: ECMAScript 5
  25. - from: ECMASCRIPT1
  26. to: ECMASCRIPT1 # because "ECMASCRIPT1" is allowed
  27. # `tags` are keywords
  28. # Some `tag` means special meaning
  29. tags:
  30. - noun
  31. - JavaScript

This format is similar with prh.
Proofdict includes some additional features.

allows

allows has defined typical patterns.

typical patterns

  • {{COMBINATION_WORD}}: ignore combination word like node-webkit

When pattern is webkit and set allows to {{COMBINATION_WORD}}, ignore /-webkit/ and webkit-.
As a result, this pattern match webkit, but does not match node-webkit.

Example

  1. id: JavaScript
  2. description: 'JavaScript is not Java Script'
  3. expected: JavaScript
  4. patterns:
  5. - /javascript/i
  6. - /Java Script/i
  7. allows:
  8. - {{COMBINATION_WORD}} # allow "x-javascript"
  9. specs:
  10. - from: javascript
  11. to: JavaScript
  12. - from: java script
  13. to: JavaScript
  14. - from: Java script
  15. to: JavaScript
  16. - from: x-javascript
  17. to: x-javascript
  18. tags:
  19. - noun
  20. - JavaScript

modules

This repository is monorepo.

This repository includes following modules.

  • @proofdict/tester"">@proofdict/tester
    • core logic
  • @proofdict/tester-cli"">@proofdict/tester-cli
    • run test for dictionary from CLI
  • @proofdict/textlint-rule-proofdict"">@proofdict/textlint-rule-proofdict
    • textlint rule for proofdict’s dictionary

Changelog

See Releases page.

Running tests

Install devDependencies and Run npm test:

  1. npm i -d && npm test

Contributing

Pull requests and stars are always welcome.

For bugs and feature requests, please create an issue.

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Author

License

MIT © azu

Acknowledge