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

[l3tl-analysis] \tl_analysis_map_inline関数で和文文字トークンがカテゴリコード 6 と判定される #3

Open
h20y6m opened this issue Sep 2, 2022 · 1 comment

Comments

@h20y6m
Copy link
Owner

h20y6m commented Sep 2, 2022

l3tl-analysisで和文文字トークンがカテゴリコード 6 と判定される

\ExplSyntaxOn
\tl_analysis_map_inline:nn
  { 日本語 }
  { \iow_term:n { [#1] [#2] [#3] } }
  % #1: 展開するとトークンになるトークン列
  % #2: トークンの文字コード(制御綴は-1)
  % #3: トークンのカテゴリコード(16進、制御綴は0)
\ExplSyntaxOff

pTeX:

[\exp_not:n {日}][37882][6]
[\exp_not:n {本}][38523][6]
[\exp_not:n {語}][36074][6]

Slack にて h_kitagawa さんより:

最後の例は \__tl_analysis_b_char:Nww を直せばいいのですかね.ただ 16 進 2 桁を返していいのかは要調査ですが.

10 と 2 桁を返そうとすると結果が [\exp_not:n {日}][050940][1] となってしまう…….

⟨tokens⟩ \s__tl ⟨catcode⟩ ⟨char code⟩ \s__tl という内部フォーマットを変えてもらわないとだめかなあ…….


カテゴリコードを2桁にするのは l3regex で単一トークンを仮定しているコードがあったりして大きな変更になりそう。

@h20y6m
Copy link
Owner Author

h20y6m commented Sep 9, 2022

https://github.com/h20y6m/plexpl3/tree/tl-analysis-kanji で和文カテゴリコードを 16 進 2 桁を返すのをやってみた。

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