Upgrade to Pro — share decks privately, control downloads, hide ads and more …

LibreOfficeで日本語Linterが使いたい

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.

 LibreOfficeで日本語Linterが使いたい

Avatar for Kenichiro MATOHARA

Kenichiro MATOHARA

December 14, 2024
Tweet

More Decks by Kenichiro MATOHARA

Other Decks in Technology

Transcript

  1. 前回の補足 Whisperを日本語に最適化して高速化したkotoba-whisper v2 の紹介 Whisper.cpp + kotoba-whisper v2.1を試したがその後 v2.2がリリース v2.0

    → whisper-large-v3 モデルを蒸留技術により日本語 に最適化 v2.1 → 句読点に対応 v2.2 → ダイアライゼーション(話者認識)に対応 OpenAI Whisper + kotoba-whisper v2.2をIntel® Core™ i7-10510Uで作業しながら5分の音声で試すと実時間の 3倍近く,RAMは5GB程使用 3
  2. LibreOffice Writerのファイルをプ レーンテキストに変換 LibreOffice同梱の soffice コマンド → STDOUTへの出力方法 がわからない Pandocを利用

    $ soffice --headless --convert-to "txt:Text (encoded):UTF8" ./test.odt $ cat test.txt Github,youtubeとか 食べれますか? $ pandoc test.odt -t plain Github,youtubeとか 食べれますか? 8
  3. 標準入力からtextlint $ pandoc test.odt -t plain | textlint --color --stdin

    --stdin-filename text.txt text.txt ✓ error Github, => GitHub, ✓ error 全角のピリオドとカンマは使用しません。 ✓ error youtube => YouTube error 文末が"。"で終わっていません。 error ら抜き言葉を使用しています。 error Disallow to use "?" ✓ error 疑問符(?)を使用する場合は「全角」で表記します。 ✖ 7 problems (7 errors, 0 warnings) ✓ 4 fixable problems. Try to run: $ textlint --fix [file] 9
  4. 保存したときに実行する inotifywaitでファイルを監視し,ファイルに変更があった時に textlintを実行する $ inotifywait test.odt && pandoc test.odt -t

    plain | textlint --color --stdin --stdin-filename text.txt | aha | xs Setting up watches. Watches established. test.odt OPEN text.txt ✓ error Github, => GitHub, ✓ error 全角のピリオドとカンマは使用しません。 ✓ error youtube => YouTube error 文末が"。"で終わっていません。 error ら抜き言葉を使用しています。 error Disallow to use "?" ✓ error 疑問符(?)を使用する場合は「全角」で表記します。 ✖ 7 problems (7 errors, 0 warnings) ✓ 4 fixable problems. Try to run: $ textlint --fix [file] 10
  5. 無限ループ 無限ループの中に入れて保存のたびに実行 $ while true; do inotifywait test.odt && \

    pandoc test.odt -t plain | \ textlint --color --stdin --stdin-filename text.txt; done 11
  6. 12

  7. 奥付 発表 2024-12- 14(sat) 発表者 利用ソフトウェア NeiVim + textlint +

    ライセンス 小江戸らぐ 12月のオフな集まり(第269回) Kenichiro Matohara(matoken) Asciidoctor Reveal.js CC BY 4.0 14