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

Enhance SpaceBetweenAlphabeticalWordValidator #740

Conversation

midnightSuyama
Copy link
Contributor

Add skip character of SpaceBetweenAlphabeticalWordValidator.

New properties

  • skip_before_chars
  • skip_after_chars

Examples

Document file

iPhone は iPod・携帯電話・インターネットの融合。

Configuration file

        <validator name="SpaceBetweenAlphabeticalWord">
            <property name="skip_before_chars" value="。、・(「『"/>
            <property name="skip_after_chars" value="。、・)」』"/>
        </validator>

@coveralls
Copy link

Coverage Status

Coverage increased (+0.007%) to 90.898% when pulling 79b38c5 on midnightSuyama:enhance_SpaceBetweenAlphabeticalWordValidator into 8f17124 on redpen-cc:master.

@takahi-i
Copy link
Member

Very sorry for the late response.. and thank you very much for the valuable changes @midnightSuyama!

@@ -40,7 +40,9 @@
private final Pattern pat = Pattern.compile(shard + "\\s+(" + word + ")\\s+" + shard);

public SpaceBetweenAlphabeticalWordValidator() {
super("forbidden", false); // Spaces are enforced (false) or forbidden (true)
super("forbidden", false, // Spaces are enforced (false) or forbidden (true)
"skip_before_chars", "",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to shorten the configuration names. If you are ok, could you please rename skip_before_chars into skip_before and skip_after_chars to skip_after?

@coveralls
Copy link

Coverage Status

Coverage increased (+0.007%) to 90.898% when pulling dcf1165 on midnightSuyama:enhance_SpaceBetweenAlphabeticalWordValidator into 8f17124 on redpen-cc:master.

@midnightSuyama
Copy link
Contributor Author

@takahi-i All right, renamed.

Thanks :)

@takahi-i
Copy link
Member

LGTM

@takahi-i takahi-i merged commit ad3371a into redpen-cc:master Jan 15, 2017
@takahi-i
Copy link
Member

Thanks a lot @midnightSuyama! Merged.

@takahi-i
Copy link
Member

Ref issue for this feature: redpen-cc/redpen-doc#66

@takahi-i
Copy link
Member

Added the usage: redpen-cc/redpen-doc#68

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

Successfully merging this pull request may close these issues.

3 participants