TokenizeUtil.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. /**
  2. * Copyright (c) 2013-present, Facebook, Inc.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. *
  7. * @typechecks
  8. * @stub
  9. *
  10. */
  11. 'use strict';
  12. // \u00a1-\u00b1\u00b4-\u00b8\u00ba\u00bb\u00bf
  13. // is latin supplement punctuation except fractions and superscript
  14. // numbers
  15. // \u2010-\u2027\u2030-\u205e
  16. // is punctuation from the general punctuation block:
  17. // weird quotes, commas, bullets, dashes, etc.
  18. // \u30fb\u3001\u3002\u3008-\u3011\u3014-\u301f
  19. // is CJK punctuation
  20. // \uff1a-\uff1f\uff01-\uff0f\uff3b-\uff40\uff5b-\uff65
  21. // is some full-width/half-width punctuation
  22. // \u2E2E\u061f\u066a-\u066c\u061b\u060c\u060d\uFD3e\uFD3F
  23. // is some Arabic punctuation marks
  24. // \u1801\u0964\u104a\u104b
  25. // is misc. other language punctuation marks
  26. var PUNCTUATION = '[.,+*?$|#{}()\'\\^\\-\\[\\]\\\\\\/!@%"~=<>_:;' + '\u30FB\u3001\u3002\u3008-\u3011\u3014-\u301F\uFF1A-\uFF1F\uFF01-\uFF0F' + '\uFF3B-\uFF40\uFF5B-\uFF65\u2E2E\u061F\u066A-\u066C\u061B\u060C\u060D' + '\uFD3E\uFD3F\u1801\u0964\u104A\u104B\u2010-\u2027\u2030-\u205E' + '\xA1-\xB1\xB4-\xB8\xBA\xBB\xBF]';
  27. module.exports = {
  28. getPunctuation: function getPunctuation() {
  29. return PUNCTUATION;
  30. }
  31. };