LoginSignup
2
1

More than 5 years have passed since last update.

RedPen v1.8 の新機能

Last updated at Posted at 2017-03-20

先週 RedPen v1.8 をリリースしました。以下は本バージョンで導入された変更です。

文を指定して実行

ファイルを作成しなくても、対象となる文を指定して検査できるようになりました。以下は文を指定して redpen を実行するコマンドの例です。

$redpen -s "これは、、、どうでしょう"
[2017-03-20 00:50:01.406][INFO ] cc.redpen.Main - Configuration file: /usr/local/Cellar/redpen/1.8.0/libexec/conf/redpen-conf-en.xml
[2017-03-20 00:50:01.413][INFO ] cc.redpen.config.ConfigurationLoader - Loading config from specified config file: "/usr/local/Cellar/redpen/1.8.0/libexec/conf/redpen-conf-en.xml"
[2017-03-20 00:50:01.425][INFO ] cc.redpen.config.ConfigurationLoader - Succeeded to load configuration file
[2017-03-20 00:50:01.426][INFO ] cc.redpen.config.ConfigurationLoader - Language is set to "en"
[2017-03-20 00:50:01.426][WARN ] cc.redpen.config.ConfigurationLoader - No variant configuration...
[2017-03-20 00:50:01.427][INFO ] cc.redpen.config.ConfigurationLoader - No "symbols" block found in the configuration
[2017-03-20 00:50:01.432][INFO ] cc.redpen.config.SymbolTable - Default symbol settings are loaded
[2017-03-20 00:50:01.494][INFO ] cc.redpen.parser.SentenceExtractor - "[., ?, !]" are added as a end of sentence characters
[2017-03-20 00:50:01.494][INFO ] cc.redpen.parser.SentenceExtractor - "[', "]" are added as a right quotation characters
[2017-03-20 00:50:01.835][INFO ] org.reflections.Reflections - Reflections took 60 ms to scan 1 urls, producing 5 keys and 53 values
[2017-03-20 00:50:01.882][WARN ] cc.redpen.validator.ValidatorFactory - cc.redpen.validator.section.VoidSectionValidator is deprecated
[2017-03-20 00:50:01.890][WARN ] cc.redpen.validator.ValidatorFactory - cc.redpen.validator.sentence.SpaceBeginningOfSentenceValidator is deprecated
[2017-03-20 00:50:01.904][INFO ] org.reflections.Reflections - Reflections took 2 ms to scan 1 urls, producing 160 keys and 163 values
[2017-03-20 00:50:02.032][INFO ] cc.redpen.util.DictionaryLoader - Succeeded to load UnexpandedAcronymValidator default dictionary.
[2017-03-20 00:50:02.039][INFO ] cc.redpen.util.DictionaryLoader - Succeeded to load weak expressions.
[2017-03-20 00:50:02.047][INFO ] cc.redpen.util.DictionaryLoader - Succeeded to load word frequencies.
[2017-03-20 00:50:02.048][INFO ] cc.redpen.validator.JavaScriptValidator - JavaScript validators directory: js
1: ValidationError[InvalidSymbol], Found invalid symbol "、". at line: これは、、、どうでしょう
1: ValidationError[Spelling], Found possibly misspelled word "これは、、、どうでしょう". at line: これは、、、 どうでしょう

[2017-03-20 00:50:02.063][ERROR] cc.redpen.Main - The number of errors "2" is larger than specified (limit is "1").

文を指定することで、考えた文が規約に沿っているかを手軽に検査できます。この機能は今後、JavaScript で作成する機能拡張のテスト用途で利用される予定です。

一部の機能を Deprecated に

ユーザの方より、一部の機能の名前がわかりにくいという意見をもらっていました。例えば、VoidSection は名前からは何を検査しているのか分かりにくいです。そこで VoidSection を Deprecated にした上で、同じ役割の機能 EmptySection を追加しました。また、SpaceBeginningOfSentence には実装上の問題があったので、一度 Deprecated に設定しました。うまく修正できれば、再び復活させる予定です。

デフォルトの設定をマイルドに

シンボルのデフォルト設定をみなおして、不要なエラーを減らしました。たとえば、テキストマークアップ型の原稿フォーマット、Re:VIEW でエラーが出てしまっていましたが、このバージョンからは出なくなっています。今後も不要なエラーを減らすように開発を進めてゆくつもりです。

問題をいくつか修正

  • redpen-serverstop オプションで止まらない問題を修正しました。
  • Markdown の見出しに画像が使用できるようになりました。
  • SpaceBetweenAlphabeticalWord でエラーをスキップするパラメタ(skip_beforeskip_afterをサポートしました。これは @midnightSuyamaさんがコントリビュートしてくれた機能です :pray:

次のバージョンに向けて

現在 RedPen から出力されるエラーメッセージは利用するPCのロケールから自動で決定されます。しかし、共用のPCなどでは、使いたい言語でエラーが表示されないという問題が報告されてきました。次のバージョンでは、ユーザはコマンドラインやサーバ起動コマンドでエラーメッセージの言語を指定できる予定です。また restrucuredText フォーマットにも対応したいと考えています。

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1