TokenizeUtil.js.flow 1.3 KB

123456789101112131415161718192021222324252627282930
  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. * @providesModule TokenizeUtil
  8. * @typechecks
  9. * @stub
  10. * @flow
  11. */
  12. 'use strict'; // \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' + '\u00a1-\u00b1\u00b4-\u00b8\u00ba\u00bb\u00bf]';
  27. module.exports = {
  28. getPunctuation: (): string => PUNCTUATION
  29. };