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

Seems to affect non-Chinese non-ASCII characters (e.g. "ü") as well #26

Open
x-ji opened this issue Aug 7, 2018 · 1 comment
Open

Comments

@x-ji
Copy link

x-ji commented Aug 7, 2018

If I write a German word (e.g. Kündigung), spaces are automatically inserted around ü, which is not sensible. This package should strictly only work on CJK characters.

I think this might have something to do with #17. However that is a really special use case, support for which should only be enabled via a dedicated variable, instead of by default.

@x-ji
Copy link
Author

x-ji commented Aug 8, 2018

Looked into the source code a bit but not sure why this happened:

(defvar pangu-spacing-chinese-before-english-regexp
  (rx (group-n 1 (category chinse-two-byte))
      (group-n 2 (in "a-zA-Z0-9")))
  "Regexp to find Chinese character before English character.")

(defvar pangu-spacing-chinese-after-english-regexp
  (rx (group-n 1 (in "a-zA-Z0-9"))
      (group-n 2 (category chinse-two-byte)))
  "Regexp to find Chinese character after English character.")

(defvar pangu-spacing-chinese-before-english-regexp-exclude
  (rx (group-n 1 (or (in "。,!?;:「」()、")))
      (group-n 2 (in "a-zA-Z0-9")))
  "Excluded regexp to find Chinese character before English character.")

(defvar pangu-spacing-chinese-after-english-regexp-exclude
  (rx (group-n 1 (in "a-zA-Z0-9"))
      (group-n 2 (or (in "。,!?;:「」()、"))))
  "Excluded regexp to find Chinese character after English character.")

These functions doesn't seem to include any non-Chinese character?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant