Skip to content

Latest commit

 

History

History
2163 lines (1293 loc) · 56.4 KB

File metadata and controls

2163 lines (1293 loc) · 56.4 KB

Rules documentation

There are currently 67 rules available.

Rules

AddNonBreakingSpaceAfterDoctorRule

Description

Add a non-breaking space after Dr.. This binds the title and the name together and makes it easier to read.

Transformation example

  • With a thin non-breaking space (\xE2\x80\xAF):

    - Dr. Max Mustermann
    + Dr.\xE2\x80\xAFMax Mustermann
  • With a non-breaking space for HTML ( ):

    - Dr. Max Mustermann
    + Dr. Max Mustermann

Possible rule customization

There is 1 possibility to customize this rule:

  • Configure the type of the space. Per default, a thin non-breaking space will be used.

    $addNonBreakingSpaceAfterDoctorRule->setNonBreakingSpace($nonBreakingSpace);

File

This rule is located under ../src/Rule/AddNonBreakingSpaceAfterDoctorRule.php


AddNonBreakingSpaceAfterProfessorRule

Description

Add a non-breaking space after Prof.. This binds the title and the name together and makes it easier to read.

Transformation example

  • With a thin non-breaking space (\xE2\x80\xAF):

    - Prof. Max Mustermann
    + Prof.\xE2\x80\xAFMax Mustermann
  • With a non-breaking space for HTML ( ):

    - Prof. Max Mustermann
    + Prof. Max Mustermann

Possible rule customization

There is 1 possibility to customize this rule:

  • Configure the type of the space. Per default, a thin non-breaking space will be used.

    $addNonBreakingSpaceAfterProfessorRule->setNonBreakingSpace($nonBreakingSpace);

File

This rule is located under ../src/Rule/AddNonBreakingSpaceAfterProfessorRule.php


AddNonBreakingSpaceBeforeAndAfterAmpersandRule

Description

Add non-breaking spaces before and after ampersand characters. This rule affects only situations, where the ampersand has whitespaces before and after (T & D or Tobias & Deborah).

Transformation example

  • With a thin non-breaking space (\xE2\x80\xAF):

    - Welcome to Tobias & Deborah!
    + Welcome to Tobias\xE2\x80\xAF&\xE2\x80\xAFDeborah!
  • With a narrow non-breaking space for HTML ( ):

    - Welcome to Tobias & Deborah!
    + Welcome to Tobias & Deborah!

Possible rule customization

There is 1 possibility to customize this rule:

  • Configure the type of the space. Per default, a thin non-breaking space will be used.

    $addNonBreakingSpaceBeforeAndAfterAmpersandRule->setNonBreakingSpace($nonBreakingSpace);

File

This rule is located under ../src/Rule/AddNonBreakingSpaceBeforeAndAfterAmpersandRule.php


AddNonBreakingSpaceBeforeColonRule

Description

Add a non-breaking space between before a colon to disallow separating it from the word before.

Transformation example

- Concept, création et réalisation technique : Bit&Black
+ Concept, création et réalisation technique\xE2\x80\xAF: Bit&Black

Possible rule customization

There is 1 possibility to customize this rule:

  • Configure the type of the space. Per default, a thin non-breaking space will be used.

    $addNonBreakingSpaceBeforeColonRule->setNonBreakingSpace($nonBreakingSpace);

File

This rule is located under ../src/Rule/AddNonBreakingSpaceBeforeColonRule.php


AddNonBreakingSpaceBeforeExclamationMarkRule

Description

Add a non-breaking space between before a exclamation mark to disallow separating it from the word before.

Transformation example

- On y va !
+ On y va\xE2\x80\xAF!

Possible rule customization

There is 1 possibility to customize this rule:

  • Configure the type of the space. Per default, a thin non-breaking space will be used.

    $addNonBreakingSpaceBeforeExclamationMarkRule->setNonBreakingSpace($nonBreakingSpace);

File

This rule is located under ../src/Rule/AddNonBreakingSpaceBeforeExclamationMarkRule.php


AddNonBreakingSpaceBeforeQuestionMarkRule

Description

Add a non-breaking space between before a question mark to disallow separating it from the word before.

Transformation example

- On y va ?
+ On y va\xE2\x80\xAF?

Possible rule customization

There is 1 possibility to customize this rule:

  • Configure the type of the space. Per default, a thin non-breaking space will be used.

    $addNonBreakingSpaceBeforeQuestionMarkRule->setNonBreakingSpace($nonBreakingSpace);

File

This rule is located under ../src/Rule/AddNonBreakingSpaceBeforeQuestionMarkRule.php


AddNonBreakingSpaceBeforeSemicolonRule

Description

Add a non-breaking space between before a semicolon to disallow separating it from the word before.

Transformation example

- Concept, création et réalisation technique : Bit&Black
+ Concept, création et réalisation technique\xE2\x80\xAF: Bit&Black

Possible rule customization

There is 1 possibility to customize this rule:

  • Configure the type of the space. Per default, a thin non-breaking space will be used.

    $addNonBreakingSpaceBeforeSemicolonRule->setNonBreakingSpace($nonBreakingSpace);

File

This rule is located under ../src/Rule/AddNonBreakingSpaceBeforeSemicolonRule.php


AddNonBreakingSpaceBeforeUhrRule

Description

Add a non-breaking space before the word Uhr to disallow separating it from the time before.

Transformation example

- Es ist 12.30 Uhr.
+ Es ist 12.30\xC2\xA0Uhr.

Possible rule customization

There is 1 possibility to customize this rule:

  • Configure the type of the space. Per default, a non-breaking space will be used.

    $addNonBreakingSpaceBeforeUhrRule->setNonBreakingSpace($nonBreakingSpace);

File

This rule is located under ../src/Rule/AddNonBreakingSpaceBeforeUhrRule.php


AddNonBreakingSpaceBehindWordAfterColonRule

Description

Replace a whitespace with a non-breaking space between a short word and its following word if the short word follows a colon :. This can improve the text wrap in ragged typesetting, as short words do not remain alone at the end of a line. Attention: This rule is only suitable for ragged text, not for justified text.

Transformation example

- Glaube mir: es war so schön!
+ Glaube mir: es\xC2\xA0war so schön!

Possible rule customization

There are 3 possibilities to customize this rule:

  • Configure the type of the space. Per default, a non-breaking space will be used.

    $addNonBreakingSpaceBehindWordAfterColonRule->setNonBreakingSpace($nonBreakingSpace);
  • Configure the minimum length for the word after the colon. It needs to have a length of at least 3 characters per default.

    $addNonBreakingSpaceBehindWordAfterColonRule->setWordMaxLength($wordMaxLength);
  • Configure the maximum length for the second word after the colon. By default, it must not have more than 5 characters.

    $addNonBreakingSpaceBehindWordAfterColonRule->setWordAheadMaxLength($wordAheadMaxLength);

File

This rule is located under ../src/Rule/AddNonBreakingSpaceBehindWordAfterColonRule.php


AddNonBreakingSpaceBehindWordAfterCommaRule

Description

Replace a whitespace with a non-breaking space between a short word and its following word if the short word follows a comma ,. This can improve the text wrap in ragged typesetting, as short words do not remain alone at the end of a line. Attention: This rule is only suitable for ragged text, not for justified text.

Transformation example

- Glaube mir, es war so schön!
+ Glaube mir, es\xC2\xA0war so schön!

Possible rule customization

There are 3 possibilities to customize this rule:

  • Configure the type of the space. Per default, a non-breaking space will be used.

    $addNonBreakingSpaceBehindWordAfterCommaRule->setNonBreakingSpace($nonBreakingSpace);
  • Configure the minimum length for the word after the comma. It needs to have a length of at least 3 characters per default.

    $addNonBreakingSpaceBehindWordAfterCommaRule->setWordMaxLength($wordMaxLength);
  • Configure the maximum length for the second word after the comma. By default, it must not have more than 5 characters.

    $addNonBreakingSpaceBehindWordAfterCommaRule->setWordAheadMaxLength($wordAheadMaxLength);

File

This rule is located under ../src/Rule/AddNonBreakingSpaceBehindWordAfterCommaRule.php


AddNonBreakingSpaceBehindWordAfterDotRule

Description

Replace a whitespace with a non-breaking space between a short word and its following word if the short word follows a dot .. This can improve the text wrap in ragged typesetting, as short words do not remain alone at the end of a line. Attention: This rule is only suitable for ragged text, not for justified text.

Transformation example

- Schon vorbei. Von wegen!
+ Schon vorbei. Von\xC2\xA0wegen!

Possible rule customization

There are 3 possibilities to customize this rule:

  • Configure the type of the space. Per default, a non-breaking space will be used.

    $addNonBreakingSpaceBehindWordAfterDotRule->setNonBreakingSpace($nonBreakingSpace);
  • Configure the minimum length for the word after the dot. It needs to have a length of at least 3 characters per default.

    $addNonBreakingSpaceBehindWordAfterDotRule->setWordMaxLength($wordMaxLength);
  • Configure the maximum length for the second word after the dot. By default, it must not have more than 5 characters.

    $addNonBreakingSpaceBehindWordAfterDotRule->setWordAheadMaxLength($wordAheadMaxLength);

File

This rule is located under ../src/Rule/AddNonBreakingSpaceBehindWordAfterDotRule.php


AddNonBreakingSpaceBehindWordAfterEmDashRule

Description

Replace a whitespace with a non-breaking space between a short word and its following word if the short word follows a em dash . This can improve the text wrap in ragged typesetting, as short words do not remain alone at the end of a line. Attention: This rule is only suitable for ragged text, not for justified text.

Transformation example

- Already over — not at all!
+ Already over — not\xC2\xA0at all!

Possible rule customization

There are 3 possibilities to customize this rule:

  • Configure the type of the space. Per default, a non-breaking space will be used.

    $addNonBreakingSpaceBehindWordAfterEmDashRule->setNonBreakingSpace($nonBreakingSpace);
  • Configure the minimum length for the word after the em dash. It needs to have a length of at least 3 characters per default.

    $addNonBreakingSpaceBehindWordAfterEmDashRule->setWordMaxLength($wordMaxLength);
  • Configure the maximum length for the second word after the em dash. By default, it must not have more than 5 characters.

    $addNonBreakingSpaceBehindWordAfterEmDashRule->setWordAheadMaxLength($wordAheadMaxLength);

File

This rule is located under ../src/Rule/AddNonBreakingSpaceBehindWordAfterEmDashRule.php


AddNonBreakingSpaceBehindWordAfterEnDashRule

Description

Replace a whitespace with a non-breaking space between a short word and its following word if the short word follows a en dash . This can improve the text wrap in ragged typesetting, as short words do not remain alone at the end of a line. Attention: This rule is only suitable for ragged text, not for justified text.

Transformation example

- Schon vorbei – von wegen!
+ Schon vorbei – von\xC2\xA0wegen!

Possible rule customization

There are 3 possibilities to customize this rule:

  • Configure the type of the space. Per default, a non-breaking space will be used.

    $addNonBreakingSpaceBehindWordAfterEnDashRule->setNonBreakingSpace($nonBreakingSpace);
  • Configure the minimum length for the word after the en dash. It needs to have a length of at least 3 characters per default.

    $addNonBreakingSpaceBehindWordAfterEnDashRule->setWordMaxLength($wordMaxLength);
  • Configure the maximum length for the second word after the en dash. By default, it must not have more than 5 characters.

    $addNonBreakingSpaceBehindWordAfterEnDashRule->setWordAheadMaxLength($wordAheadMaxLength);

File

This rule is located under ../src/Rule/AddNonBreakingSpaceBehindWordAfterEnDashRule.php


AddNonBreakingSpaceBehindWordAfterExclamationMarkRule

Description

Replace a whitespace with a non-breaking space between a short word and its following word if the short word follows an exclamation mark !. This can improve the text wrap in ragged typesetting, as short words do not remain alone at the end of a line. Attention: This rule is only suitable for ragged text, not for justified text.

Transformation example

- Sicher! Ich denke nicht.
+ Sicher! Ich\xC2\xA0denke nicht.

Possible rule customization

There are 3 possibilities to customize this rule:

  • Configure the type of the space. Per default, a non-breaking space will be used.

    $addNonBreakingSpaceBehindWordAfterExclamationMarkRule->setNonBreakingSpace($nonBreakingSpace);
  • Configure the minimum length for the word after the exclamation mark. It needs to have a length of at least 3 characters per default.

    $addNonBreakingSpaceBehindWordAfterExclamationMarkRule->setWordMaxLength($wordMaxLength);
  • Configure the maximum length for the second word after the exclamation mark. By default, it must not have more than 5 characters.

    $addNonBreakingSpaceBehindWordAfterExclamationMarkRule->setWordAheadMaxLength($wordAheadMaxLength);

File

This rule is located under ../src/Rule/AddNonBreakingSpaceBehindWordAfterExclamationMarkRule.php


AddNonBreakingSpaceBehindWordAfterQuestionMarkRule

Description

Replace a whitespace with a non-breaking space between a short word and its following word if the short word follows a question mark ?. This can improve the text wrap in ragged typesetting, as short words do not remain alone at the end of a line. Attention: This rule is only suitable for ragged text, not for justified text.

Transformation example

- Sicher? Ich denke nicht.
+ Sicher? Ich\xC2\xA0denke nicht.

Possible rule customization

There are 3 possibilities to customize this rule:

  • Configure the type of the space. Per default, a non-breaking space will be used.

    $addNonBreakingSpaceBehindWordAfterQuestionMarkRule->setNonBreakingSpace($nonBreakingSpace);
  • Configure the minimum length for the word after the question mark. It needs to have a length of at least 3 characters per default.

    $addNonBreakingSpaceBehindWordAfterQuestionMarkRule->setWordMaxLength($wordMaxLength);
  • Configure the maximum length for the second word after the question mark. By default, it must not have more than 5 characters.

    $addNonBreakingSpaceBehindWordAfterQuestionMarkRule->setWordAheadMaxLength($wordAheadMaxLength);

File

This rule is located under ../src/Rule/AddNonBreakingSpaceBehindWordAfterQuestionMarkRule.php


AddNonBreakingSpaceBehindWordAfterSemicolonRule

Description

Replace a whitespace with a non-breaking space between a short word and its following word if the short word follows a semicolon ;. This can improve the text wrap in ragged typesetting, as short words do not remain alone at the end of a line. Attention: This rule is only suitable for ragged text, not for justified text.

Transformation example

- Glaube mir; es war so schön!
+ Glaube mir; es\xC2\xA0war so schön!

Possible rule customization

There are 3 possibilities to customize this rule:

  • Configure the type of the space. Per default, a non-breaking space will be used.

    $addNonBreakingSpaceBehindWordAfterSemicolonRule->setNonBreakingSpace($nonBreakingSpace);
  • Configure the minimum length for the word after the semicolon. It needs to have a length of at least 3 characters per default.

    $addNonBreakingSpaceBehindWordAfterSemicolonRule->setWordMaxLength($wordMaxLength);
  • Configure the maximum length for the second word after the semicolon. By default, it must not have more than 5 characters.

    $addNonBreakingSpaceBehindWordAfterSemicolonRule->setWordAheadMaxLength($wordAheadMaxLength);

File

This rule is located under ../src/Rule/AddNonBreakingSpaceBehindWordAfterSemicolonRule.php


AddNonBreakingSpaceBetweenEingetragenerAndVereinRule

Description

Add a non-breaking space between e. and V. to disallow separating those two.

Transformation example

- Supersport 500 e.V.
+ Supersport 500 e.\xC2\xA0V.
- Supersport 500 e. V.
+ Supersport 500 e.\xC2\xA0V.

Possible rule customization

There is 1 possibility to customize this rule:

  • Configure the type of the space. Per default, a thin non-breaking space will be used.

    $addNonBreakingSpaceBetweenEingetragenerAndVereinRule->setNonBreakingSpace($nonBreakingSpace);

File

This rule is located under ../src/Rule/AddNonBreakingSpaceBetweenEingetragenerAndVereinRule.php


AddNonBreakingSpaceBetweenGebAndYearRule

Description

Add a thin non-breaking space between the word geb. and the following year to disallow separating them from each other. Attention: This rule may also find numbers at the beginning of a sentence, where the previous sentence ends with geb.. It should only be used manually.

Transformation example

- Tobias Mayer (geb. 1723)
+ Tobias Mayer (geb.\xE2\x80\xAF1723)

Possible rule customization

There is 1 possibility to customize this rule:

  • Configure the type of the space. Per default, a thin non-breaking space will be used.

    $addNonBreakingSpaceBetweenGebAndYearRule->setNonBreakingSpace($nonBreakingSpace);

File

This rule is located under ../src/Rule/AddNonBreakingSpaceBetweenGebAndYearRule.php


AddNonBreakingSpaceBetweenGuillemetLeftOpenAndWordRule

Description

Add a thin non-breaking space between a left angle quote « and a word after to disallow separating those two.

Transformation example

- J'ai dit « non » à toi.
+ J'ai dit «\xE2\x80\xAFnon » à toi.

Possible rule customization

There is 1 possibility to customize this rule:

  • Configure the type of the space. Per default, a thin non-breaking space will be used.

    $addNonBreakingSpaceBetweenGuillemetLeftOpenAndWordRule->setNonBreakingSpace($nonBreakingSpace);

File

This rule is located under ../src/Rule/AddNonBreakingSpaceBetweenGuillemetLeftOpenAndWordRule.php


AddNonBreakingSpaceBetweenGuillemetRightCloseAndWordRule

Description

Add a thin non-breaking space between a right angle quote » and a word before to disallow separating those two.

Transformation example

- J'ai dit « non » à toi.
+ J'ai dit « non\xE2\x80\xAF» à toi.

Possible rule customization

There is 1 possibility to customize this rule:

  • Configure the type of the space. Per default, a thin non-breaking space will be used.

    $addNonBreakingSpaceBetweenGuillemetRightCloseAndWordRule->setNonBreakingSpace($nonBreakingSpace);

File

This rule is located under ../src/Rule/AddNonBreakingSpaceBetweenGuillemetRightCloseAndWordRule.php


AddNonBreakingSpaceBetweenGuillemetSingleLeftOpenAndWordRule

Description

Add a thin non-breaking space between a single left angle quote and a word after to disallow separating those two.

Transformation example

- Je t'ai dit « non », car « tout à l'heure, tu m'as dit ‹ oui › ».
+ Je t'ai dit « non », car « tout à l'heure, tu m'as dit ‹\xE2\x80\xAFoui › ».

Possible rule customization

There is 1 possibility to customize this rule:

  • Configure the type of the space. Per default, a thin non-breaking space will be used.

    $addNonBreakingSpaceBetweenGuillemetSingleLeftOpenAndWordRule->setNonBreakingSpace($nonBreakingSpace);

File

This rule is located under ../src/Rule/AddNonBreakingSpaceBetweenGuillemetSingleLeftOpenAndWordRule.php


AddNonBreakingSpaceBetweenGuillemetSingleRightCloseAndWordRule

Description

Add a thin non-breaking space between a single right angle quote and a word before to disallow separating those two.

Transformation example

- Je t'ai dit « non », car « tout à l'heure, tu m'as dit ‹ oui › ».
+ Je t'ai dit « non », car « tout à l'heure, tu m'as dit ‹ oui\xE2\x80\xAF› ».

Possible rule customization

There is 1 possibility to customize this rule:

  • Configure the type of the space. Per default, a thin non-breaking space will be used.

    $addNonBreakingSpaceBetweenGuillemetSingleRightCloseAndWordRule->setNonBreakingSpace($nonBreakingSpace);

File

This rule is located under ../src/Rule/AddNonBreakingSpaceBetweenGuillemetSingleRightCloseAndWordRule.php


AddNonBreakingSpaceBetweenLastAndPenultimateWords

Description

Add a non-breaking space between the last and the penultimate words. Binding those words may lead to a more balanced text layout, where the last text row can't contain a single word only.

Transformation example

- A short last word at the end.
+ A short last word at the\xC2\xA0end.

Possible rule customization

There are 2 possibilities to customize this rule:

  • Configure the maximum length for the last word. It's 6 characters per default.

    $addNonBreakingSpaceBetweenLastAndPenultimateWords->setLastWordMaxLength($lastWordMaxLength);
  • Configure the type of the space.

    $addNonBreakingSpaceBetweenLastAndPenultimateWords->setNonBreakingSpace($nonBreakingSpace);

File

This rule is located under ../src/Rule/AddNonBreakingSpaceBetweenLastAndPenultimateWords.php


AddNonBreakingSpaceBetweenNAndChrRule

Description

Add a thin non-breaking space between the words n. and Chr. to disallow separating them from each other. Attention: This rule may also find situations, where those words mark an end and a beginning of a sentence. It should only be used manually.

Transformation example

- 25 n. Chr.
+ 25 n.\xE2\x80\xAFChr.

Possible rule customization

There is 1 possibility to customize this rule:

  • Configure the type of the space. Per default, a thin non-breaking space will be used.

    $addNonBreakingSpaceBetweenNAndChrRule->setNonBreakingSpace($nonBreakingSpace);

File

This rule is located under ../src/Rule/AddNonBreakingSpaceBetweenNAndChrRule.php


AddNonBreakingSpaceBetweenNumberAndJahrRule

Description

Add a non-breaking space between Jahr and the number before to disallow separating those two.

Transformation example

- Vor 30 Jahren
+ Vor 30\xC2\xA0Jahren

Possible rule customization

There is 1 possibility to customize this rule:

  • Configure the type of the space. Per default, a non-breaking space will be used.

    $addNonBreakingSpaceBetweenNumberAndJahrRule->setNonBreakingSpace($nonBreakingSpace);

File

This rule is located under ../src/Rule/AddNonBreakingSpaceBetweenNumberAndJahrRule.php


AddNonBreakingSpaceBetweenNumberAndJahrhundertRule

Description

Add a non-breaking space between a number (ending with a dot) and the following word Jahrhundert to disallow separating them from each other. Attention: This rule may also find numbers at the end of a sentence, where the new sentence starts with the word Jahrhundert. It should only be used manually.

Transformation example

- Im 18. Jahrhundert
+ Im 18.\xC2\xA0Jahrhundert

Possible rule customization

There is 1 possibility to customize this rule:

  • Configure the type of the space. Per default, a thin non-breaking space will be used.

    $addNonBreakingSpaceBetweenNumberAndJahrhundertRule->setNonBreakingSpace($nonBreakingSpace);

File

This rule is located under ../src/Rule/AddNonBreakingSpaceBetweenNumberAndJahrhundertRule.php


AddNonBreakingSpaceBetweenNumberAndJhRule

Description

Add a non-breaking space between a number (ending with a dot) and the following word Jh. to disallow separating them from each other. Attention: This rule may also find numbers at the end of a sentence, where the new sentence starts with Jh.. It should only be used manually.

Transformation example

- Im 18. Jh.
+ Im 18.\xC2\xA0Jh.

Possible rule customization

There is 1 possibility to customize this rule:

  • Configure the type of the space. Per default, a thin non-breaking space will be used.

    $addNonBreakingSpaceBetweenNumberAndJhRule->setNonBreakingSpace($nonBreakingSpace);

File

This rule is located under ../src/Rule/AddNonBreakingSpaceBetweenNumberAndJhRule.php


AddNonBreakingSpaceBetweenNumberAndNumberRule

Description

Add a thin non-breaking space between the words Nr. or Nummer and a following number to disallow separating them from each other.

Transformation example

- Das ist Nr. 8.
+ Das ist Nr.\xE2\x80\xAF8.
- Das ist Nummer 8.
+ Das ist Nummer\xE2\x80\xAF8.

Possible rule customization

There is 1 possibility to customize this rule:

  • Configure the type of the space. Per default, a thin non-breaking space will be used.

    $addNonBreakingSpaceBetweenNumberAndNumberRule->setNonBreakingSpace($nonBreakingSpace);

File

This rule is located under ../src/Rule/AddNonBreakingSpaceBetweenNumberAndNumberRule.php


AddNonBreakingSpaceBetweenNumberAndUnitRule

Description

Add a thin non-breaking space between a number and the following unit to disallow separating those two.

Transformation example

- 200 ° C
+ 200\xE2\x80\xAF° C

Possible rule customization

There is 1 possibility to customize this rule:

  • Configure the type of the space. Per default, a thin non-breaking space will be used.

    $addNonBreakingSpaceBetweenNumberAndUnitRule->setNonBreakingSpace($nonBreakingSpace);

File

This rule is located under ../src/Rule/AddNonBreakingSpaceBetweenNumberAndUnitRule.php


AddNonBreakingSpaceBetweenVAndChrRule

Description

Add a thin non-breaking space between the words v. and Chr. to disallow separating them from each other. Attention: This rule may also find situations, where those words mark an end and a beginning of a sentence. It should only be used manually.

Transformation example

- 25 v. Chr.
+ 25 v.\xE2\x80\xAFChr.

Possible rule customization

There is 1 possibility to customize this rule:

  • Configure the type of the space. Per default, a thin non-breaking space will be used.

    $addNonBreakingSpaceBetweenVAndChrRule->setNonBreakingSpace($nonBreakingSpace);

File

This rule is located under ../src/Rule/AddNonBreakingSpaceBetweenVAndChrRule.php


AddNonBreakingSpaceBetweenWordNumberAndNumberRule

Description

Add a thin non-breaking space between the words Nr. or Number and a following number to disallow separating them from each other.

Transformation example

- This is no. 8.
+ This is no.\xE2\x80\xAF8.
- This is number 8.
+ This is number\xE2\x80\xAF8.
- № 8.
+ №\xE2\x80\xAF8.

Possible rule customization

There is 1 possibility to customize this rule:

  • Configure the type of the space. Per default, a thin non-breaking space will be used.

    $addNonBreakingSpaceBetweenWordNumberAndNumberRule->setNonBreakingSpace($nonBreakingSpace);

File

This rule is located under ../src/Rule/AddNonBreakingSpaceBetweenWordNumberAndNumberRule.php


AddNonBreakingSpaceBetweenWordNumeroAndNumberRule

Description

Add a thin non-breaking space between the words or numéro and a following number to disallow separating them from each other.

Transformation example

- C'est le n° 8.
+ C'est le n°\xE2\x80\xAF8.
- C'est le numéro 8.
+ C'est le numéro\xE2\x80\xAF8.
- N°8
+ N°\xE2\x80\xAF8

Possible rule customization

There is 1 possibility to customize this rule:

  • Configure the type of the space. Per default, a thin non-breaking space will be used.

    $addNonBreakingSpaceBetweenWordNumeroAndNumberRule->setNonBreakingSpace($nonBreakingSpace);

File

This rule is located under ../src/Rule/AddNonBreakingSpaceBetweenWordNumeroAndNumberRule.php


AddNonBreakingSpaceBetweenWordNummerAndNumberRule

Description

Add a thin non-breaking space between the words Nr. or Nummer and a following number to disallow separating them from each other.

Transformation example

- Das ist Nr. 8.
+ Das ist Nr.\xE2\x80\xAF8.
- Das ist Nummer 8.
+ Das ist Nummer\xE2\x80\xAF8.

Possible rule customization

There is 1 possibility to customize this rule:

  • Configure the type of the space. Per default, a thin non-breaking space will be used.

    $addNonBreakingSpaceBetweenWordNummerAndNumberRule->setNonBreakingSpace($nonBreakingSpace);

File

This rule is located under ../src/Rule/AddNonBreakingSpaceBetweenWordNummerAndNumberRule.php


AddNonBreakingSpacesForDotSeparatedDateRule

Description

Add thin non-breaking spaces between the number of a dot separated date.

Transformation example

  • Without spaces at the beginning:

    - 01.03.2025
    + 1.\xE2\x80\xA3.\xE2\x80\xA2025
  • With spaces at the beginning:

    - 01. 03. 2025
    + 1.\xE2\x80\xA3.\xE2\x80\xA2025
  • With a narrow non-breaking space for HTML ( ):

    - 01.03.2025
    + 1. 3. 2025

Possible rule customization

There is 1 possibility to customize this rule:

  • Configure the type of the space. Per default, a thin non-breaking space will be used.

    $addNonBreakingSpacesForDotSeparatedDateRule->setNonBreakingSpace($nonBreakingSpace);

File

This rule is located under ../src/Rule/AddNonBreakingSpacesForDotSeparatedDateRule.php


AddSoftHyphenBetweenDashSeparatedWordsRule

Description

Add a non-breaking space between to words that have a dash between / to allow separating those two. This can improve the text wrap when having long words-

Transformation example

- Von Paris/Frankreich nach Stuttgart/Deutschland.
+ Von Paris/\xC2\xADFrankreich nach Stuttgart/\xC2\xADDeutschland.

Possible rule customization

There are 2 possibilities to customize this rule:

  • Configure the minimum length for the word before the dash. It needs to have a length of 3 characters per default.

    $addSoftHyphenBetweenDashSeparatedWordsRule->setMinLengthWordBefore($minLengthWordBefore);
  • Configure the minimum length for the word after the dash. It needs to have a length of 3 characters per default.

    $addSoftHyphenBetweenDashSeparatedWordsRule->setMinLengthWordAfter($minLengthWordAfter);

File

This rule is located under ../src/Rule/AddSoftHyphenBetweenDashSeparatedWordsRule.php


AddSoftHyphenToWordRule

Description

Add a soft hyphen to words to allow hyphenation. This can make the typeface appear calmer and leads to better utilisation of the available type width.

Transformation example

- Bodensee
+ Boden\xC2\xADsee

Possible rule customization

There are 5 possibilities to customize this rule:

  • Define the language code.

    $addSoftHyphenToWordRule->setLanguageCode($languageCode);
  • Define the hyphenation character.

    $addSoftHyphenToWordRule->setHyphen($hyphen);
  • Define, how many characters a word must have before the first hyphen may appear.

    $addSoftHyphenToWordRule->setMinCharacterCountBefore($minCharacterCountBefore);
  • Define, how many characters a word must have after the last hyphen.

    $addSoftHyphenToWordRule->setMinCharacterCountAfter($minCharacterCountAfter);
  • Define the minimum length a word must have to be hyphenated.

    $addSoftHyphenToWordRule->setMinWordCharacterCount($minWordCharacterCount);

File

This rule is located under ../src/Rule/AddSoftHyphenToWordRule.php


AddSpaceBehindDotRule

Description

Add a missing space behind a dot ..

Transformation example

- Ganz am Ende.Wie geht's weiter.
+ Ganz am Ende. Wie geht's weiter.

Possible rule customization

This rule doesn't allow any customization.

File

This rule is located under ../src/Rule/AddSpaceBehindDotRule.php


AddSpaceBehindExclamationMarkRule

Description

Add a missing space behind an exclamation mark !.

Transformation example

- Ganz am Ende!Wie geht's weiter!
+ Ganz am Ende! Wie geht's weiter!

Possible rule customization

This rule doesn't allow any customization.

File

This rule is located under ../src/Rule/AddSpaceBehindExclamationMarkRule.php


AddSpaceBehindQuestionMarkRule

Description

Add a missing space behind a question mark ?.

Transformation example

- Ganz am Ende?Wie geht's weiter!
+ Ganz am Ende? Wie geht's weiter!

Possible rule customization

This rule doesn't allow any customization.

File

This rule is located under ../src/Rule/AddSpaceBehindQuestionMarkRule.php


AddSpaceBetweenBracketsRule

Description

Add a hair space between brackets. The space will be added behind left (opening) brackets and before right (closing) brackets.

Transformation example

- Es geht los (warum auch immer)!
+ Es geht los (\xE2\x80\x8Awarum auch immer\xE2\x80\x8A)!

Possible rule customization

This rule doesn't allow any customization.

File

This rule is located under ../src/Rule/AddSpaceBetweenBracketsRule.php


BindNumberToNumberRule

Description

Add a thin non-breaking space between the words Nr. or Nummer and a following number to disallow separating them from each other.

Transformation example

- Das ist Nr. 8.
+ Das ist Nr.\xE2\x80\xAF8.
- Das ist Nummer 8.
+ Das ist Nummer\xE2\x80\xAF8.

Possible rule customization

There is 1 possibility to customize this rule:

  • Configure the type of the space. Per default, a thin non-breaking space will be used.

    $bindNumberToNumberRule->setNonBreakingSpace($nonBreakingSpace);

File

This rule is located under ../src/Rule/BindNumberToNumberRule.php


BindWordAfterColonRule

Description

Replace a whitespace with a non-breaking space between a short word and its following word if the short word follows a colon :. This can improve the text wrap in ragged typesetting, as short words do not remain alone at the end of a line. Attention: This rule is only suitable for ragged text, not for justified text.

Transformation example

- Glaube mir: es war so schön!
+ Glaube mir: es\xC2\xA0war so schön!

Possible rule customization

There are 3 possibilities to customize this rule:

  • Configure the type of the space. Per default, a non-breaking space will be used.

    $bindWordAfterColonRule->setNonBreakingSpace($nonBreakingSpace);
  • Configure the minimum length for the word after the colon. It needs to have a length of at least 3 characters per default.

    $bindWordAfterColonRule->setWordMaxLength($wordMaxLength);
  • Configure the maximum length for the second word after the colon. By default, it must not have more than 5 characters.

    $bindWordAfterColonRule->setWordAheadMaxLength($wordAheadMaxLength);

File

This rule is located under ../src/Rule/BindWordAfterColonRule.php


BindWordAfterCommaRule

Description

Replace a whitespace with a non-breaking space between a short word and its following word if the short word follows a comma ,. This can improve the text wrap in ragged typesetting, as short words do not remain alone at the end of a line. Attention: This rule is only suitable for ragged text, not for justified text.

Transformation example

- Glaube mir, es war so schön!
+ Glaube mir, es\xC2\xA0war so schön!

Possible rule customization

There are 3 possibilities to customize this rule:

  • Configure the type of the space. Per default, a non-breaking space will be used.

    $bindWordAfterCommaRule->setNonBreakingSpace($nonBreakingSpace);
  • Configure the minimum length for the word after the comma. It needs to have a length of at least 3 characters per default.

    $bindWordAfterCommaRule->setWordMaxLength($wordMaxLength);
  • Configure the maximum length for the second word after the comma. By default, it must not have more than 5 characters.

    $bindWordAfterCommaRule->setWordAheadMaxLength($wordAheadMaxLength);

File

This rule is located under ../src/Rule/BindWordAfterCommaRule.php


BindWordAfterDotRule

Description

Replace a whitespace with a non-breaking space between a short word and its following word if the short word follows a dot .. This can improve the text wrap in ragged typesetting, as short words do not remain alone at the end of a line. Attention: This rule is only suitable for ragged text, not for justified text.

Transformation example

- Schon vorbei. Von wegen!
+ Schon vorbei. Von\xC2\xA0wegen!

Possible rule customization

There are 3 possibilities to customize this rule:

  • Configure the type of the space. Per default, a non-breaking space will be used.

    $bindWordAfterDotRule->setNonBreakingSpace($nonBreakingSpace);
  • Configure the minimum length for the word after the dot. It needs to have a length of at least 3 characters per default.

    $bindWordAfterDotRule->setWordMaxLength($wordMaxLength);
  • Configure the maximum length for the second word after the dot. By default, it must not have more than 5 characters.

    $bindWordAfterDotRule->setWordAheadMaxLength($wordAheadMaxLength);

File

This rule is located under ../src/Rule/BindWordAfterDotRule.php


BindWordAfterEmDashRule

Description

Replace a whitespace with a non-breaking space between a short word and its following word if the short word follows a em dash . This can improve the text wrap in ragged typesetting, as short words do not remain alone at the end of a line. Attention: This rule is only suitable for ragged text, not for justified text.

Transformation example

- Already over — not at all!
+ Already over — not\xC2\xA0at all!

Possible rule customization

There are 3 possibilities to customize this rule:

  • Configure the type of the space. Per default, a non-breaking space will be used.

    $bindWordAfterEmDashRule->setNonBreakingSpace($nonBreakingSpace);
  • Configure the minimum length for the word after the em dash. It needs to have a length of at least 3 characters per default.

    $bindWordAfterEmDashRule->setWordMaxLength($wordMaxLength);
  • Configure the maximum length for the second word after the em dash. By default, it must not have more than 5 characters.

    $bindWordAfterEmDashRule->setWordAheadMaxLength($wordAheadMaxLength);

File

This rule is located under ../src/Rule/BindWordAfterEmDashRule.php


BindWordAfterEnDashRule

Description

Replace a whitespace with a non-breaking space between a short word and its following word if the short word follows a en dash . This can improve the text wrap in ragged typesetting, as short words do not remain alone at the end of a line. Attention: This rule is only suitable for ragged text, not for justified text.

Transformation example

- Schon vorbei – von wegen!
+ Schon vorbei – von\xC2\xA0wegen!

Possible rule customization

There are 3 possibilities to customize this rule:

  • Configure the type of the space. Per default, a non-breaking space will be used.

    $bindWordAfterEnDashRule->setNonBreakingSpace($nonBreakingSpace);
  • Configure the minimum length for the word after the en dash. It needs to have a length of at least 3 characters per default.

    $bindWordAfterEnDashRule->setWordMaxLength($wordMaxLength);
  • Configure the maximum length for the second word after the en dash. By default, it must not have more than 5 characters.

    $bindWordAfterEnDashRule->setWordAheadMaxLength($wordAheadMaxLength);

File

This rule is located under ../src/Rule/BindWordAfterEnDashRule.php


BindWordAfterExclamationMarkRule

Description

Replace a whitespace with a non-breaking space between a short word and its following word if the short word follows an exclamation mark !. This can improve the text wrap in ragged typesetting, as short words do not remain alone at the end of a line. Attention: This rule is only suitable for ragged text, not for justified text.

Transformation example

- Sicher! Ich denke nicht.
+ Sicher! Ich\xC2\xA0denke nicht.

Possible rule customization

There are 3 possibilities to customize this rule:

  • Configure the type of the space. Per default, a non-breaking space will be used.

    $bindWordAfterExclamationMarkRule->setNonBreakingSpace($nonBreakingSpace);
  • Configure the minimum length for the word after the exclamation mark. It needs to have a length of at least 3 characters per default.

    $bindWordAfterExclamationMarkRule->setWordMaxLength($wordMaxLength);
  • Configure the maximum length for the second word after the exclamation mark. By default, it must not have more than 5 characters.

    $bindWordAfterExclamationMarkRule->setWordAheadMaxLength($wordAheadMaxLength);

File

This rule is located under ../src/Rule/BindWordAfterExclamationMarkRule.php


BindWordAfterQuestionMarkRule

Description

Replace a whitespace with a non-breaking space between a short word and its following word if the short word follows a question mark ?. This can improve the text wrap in ragged typesetting, as short words do not remain alone at the end of a line. Attention: This rule is only suitable for ragged text, not for justified text.

Transformation example

- Sicher? Ich denke nicht.
+ Sicher? Ich\xC2\xA0denke nicht.

Possible rule customization

There are 3 possibilities to customize this rule:

  • Configure the type of the space. Per default, a non-breaking space will be used.

    $bindWordAfterQuestionMarkRule->setNonBreakingSpace($nonBreakingSpace);
  • Configure the minimum length for the word after the question mark. It needs to have a length of at least 3 characters per default.

    $bindWordAfterQuestionMarkRule->setWordMaxLength($wordMaxLength);
  • Configure the maximum length for the second word after the question mark. By default, it must not have more than 5 characters.

    $bindWordAfterQuestionMarkRule->setWordAheadMaxLength($wordAheadMaxLength);

File

This rule is located under ../src/Rule/BindWordAfterQuestionMarkRule.php


BindWordAfterSemicolonRule

Description

Replace a whitespace with a non-breaking space between a short word and its following word if the short word follows a semicolon ;. This can improve the text wrap in ragged typesetting, as short words do not remain alone at the end of a line. Attention: This rule is only suitable for ragged text, not for justified text.

Transformation example

- Glaube mir; es war so schön!
+ Glaube mir; es\xC2\xA0war so schön!

Possible rule customization

There are 3 possibilities to customize this rule:

  • Configure the type of the space. Per default, a non-breaking space will be used.

    $bindWordAfterSemicolonRule->setNonBreakingSpace($nonBreakingSpace);
  • Configure the minimum length for the word after the semicolon. It needs to have a length of at least 3 characters per default.

    $bindWordAfterSemicolonRule->setWordMaxLength($wordMaxLength);
  • Configure the maximum length for the second word after the semicolon. By default, it must not have more than 5 characters.

    $bindWordAfterSemicolonRule->setWordAheadMaxLength($wordAheadMaxLength);

File

This rule is located under ../src/Rule/BindWordAfterSemicolonRule.php


ConvertCharactersToAtCharRule

Description

Convert the characters (at) into an @ character.

Transformation example

- me(at)example.org
+ me@example.org

Possible rule customization

This rule doesn't allow any customization.

File

This rule is located under ../src/Rule/ConvertCharactersToAtCharRule.php


ConvertCharactersToCopyrightCharRule

Description

Convert the characters (c) or (C) into an © character.

Transformation example

- (c) Bit&Black
+ © Bit&Black

Possible rule customization

This rule doesn't allow any customization.

File

This rule is located under ../src/Rule/ConvertCharactersToCopyrightCharRule.php


ConvertCharactersToRegisteredCharRule

Description

Convert the characters (r) or (R) into an ® character.

Transformation example

- Apple(r)
+ Apple®

Possible rule customization

This rule doesn't allow any customization.

File

This rule is located under ../src/Rule/ConvertCharactersToRegisteredCharRule.php


ConvertCharactersToTrademarkCharRule

Description

Convert the characters (tm) or (TM) into an character.

Transformation example

- Star Wars(tm)
+ Star Wars™

Possible rule customization

This rule doesn't allow any customization.

File

This rule is located under ../src/Rule/ConvertCharactersToTrademarkCharRule.php


ConvertDashToEmDashRule

Description

Convert a dash - into an em dash when there is whitespace before and after.

Transformation example

- And if so - I don't think so!
+ And if so — I don't think so!

Possible rule customization

This rule doesn't allow any customization.

File

This rule is located under ../src/Rule/ConvertDashToEmDashRule.php


ConvertDashToEnDashRule

Description

Convert a dash - into an en dash when there is whitespace before and after.

Transformation example

- Und wenn schon - ich glaube nicht!
+ Und wenn schon – ich glaube nicht!

Possible rule customization

This rule doesn't allow any customization.

File

This rule is located under ../src/Rule/ConvertDashToEnDashRule.php


ConvertDotsToEllipsisRule

Description

Convert three or more dots ... into an ellipsis character .

Transformation example

- Ich weiß nicht...
+ Ich weiß nicht…

Possible rule customization

This rule doesn't allow any customization.

File

This rule is located under ../src/Rule/ConvertDotsToEllipsisRule.php


ConvertSpacesBetweenTimesAndNumbersRule

Description

Recognises a measurement and inserts thin non-breaking spaces before and after the multiplication mark x or ×.

Transformation example

- Format: 15 x 9 cm.
+ Format: 15\xE2\x80\xAFx\xE2\x80\xAF9 cm.
- Format: 15 × 9 cm.
+ Format: 15\xE2\x80\xAF×\xE2\x80\xAF9 cm.

Possible rule customization

This rule doesn't allow any customization.

File

This rule is located under ../src/Rule/ConvertSpacesBetweenTimesAndNumbersRule.php


ConvertXToTimesBetweenNumbersRule

Description

Convert a x character into a multiplication sign ×, when a measurement has been recognised.

Transformation example

- Format: 15 x 9 cm.
+ Format: 15 × 9 cm.

Possible rule customization

This rule doesn't allow any customization.

File

This rule is located under ../src/Rule/ConvertXToTimesBetweenNumbersRule.php


CustomRule

Description

An empty rule that can be configured completely by yourself. It allows you to define your own patterns using the two setter methods and stay in the spirit of this library:

$customRule = new CustomRule();
$customRule
    ->setSearchPattern('\s+/')
    ->setReplacePattern('\s')
;

Possible rule customization

There are 2 possibilities to customize this rule:

  • Define the search pattern.

    $customRule->setSearchPattern($searchPattern);
  • Define the replacement pattern.

    $customRule->setReplacePattern($replacePattern);

File

This rule is located under ../src/Rule/CustomRule.php


RemoveDuplicatedWhitespaceRule

Description

Remove duplicated whitespace with a single space character.

Transformation example

- Ganz am      Ende.
+ Ganz am Ende.

Possible rule customization

This rule doesn't allow any customization.

File

This rule is located under ../src/Rule/RemoveDuplicatedWhitespaceRule.php


RemoveLeadingZerosFromDotSeparatedDateRule

Description

Remove unnecessary leading zeros from a dot separated date.

Transformation example

- 01.03.2025
+ 1.3.2025
- 01. 03. 2025
+ 1. 3. 2025

Possible rule customization

This rule doesn't allow any customization.

File

This rule is located under ../src/Rule/RemoveLeadingZerosFromDotSeparatedDateRule.php


RemoveSpaceBeforeCommaRule

Description

Remove whitespace before a comma.

Transformation example

- Wir glauben , dass das Sinn macht.
+ Wir glauben, dass das Sinn macht.

Possible rule customization

This rule doesn't allow any customization.

File

This rule is located under ../src/Rule/RemoveSpaceBeforeCommaRule.php


RemoveSpaceBeforeExclamationMarkRule

Description

Remove whitespace before an exclamation mark.

Transformation example

- Ich glaube nicht !
+ Ich glaube nicht!

Possible rule customization

This rule doesn't allow any customization.

File

This rule is located under ../src/Rule/RemoveSpaceBeforeExclamationMarkRule.php


RemoveSpaceBeforeQuestionMarkRule

Description

Remove whitespace before a question mark.

Transformation example

- Glaubst du ?
+ Glaubst du?

Possible rule customization

This rule doesn't allow any customization.

File

This rule is located under ../src/Rule/RemoveSpaceBeforeQuestionMarkRule.php


RemoveUnnecessaryExclamationMarksRule

Description

Remove duplicated exclamation marks.

Transformation example

- Nein! Nein!! Nein!!! Nein!!!!
+ Nein! Nein!! Nein!! Nein!!

Possible rule customization

There is 1 possibility to customize this rule:

  • Configure the maximum permitted number of exclamation marks. This is 2 by default.

    $removeUnnecessaryExclamationMarksRule->setMaxCountExclamationMark($maxCountExclamationMark);

File

This rule is located under ../src/Rule/RemoveUnnecessaryExclamationMarksRule.php


RemoveUnnecessaryQuestionMarksRule

Description

Remove duplicated exclamation marks.

Transformation example

- Nein? Nein?? Nein??? Nein????
+ Nein? Nein?? Nein?? Nein??

Possible rule customization

There is 1 possibility to customize this rule:

  • Configure the maximum permitted number of question marks. This is 2 by default.

    $removeUnnecessaryQuestionMarksRule->setMaxCountQuestionMark($maxCountQuestionMark);

File

This rule is located under ../src/Rule/RemoveUnnecessaryQuestionMarksRule.php


RemoveWhitespaceAtBeginningRule

Description

Remove whitespace at the beginning of a paragraph or section.

Transformation example

-  Wir glauben, dass das Sinn macht.
+ Wir glauben, dass das Sinn macht.

Possible rule customization

This rule doesn't allow any customization.

File

This rule is located under ../src/Rule/RemoveWhitespaceAtBeginningRule.php