Package de.undercouch.citeproc.helper
Class SmartQuotes
- java.lang.Object
-
- de.undercouch.citeproc.helper.SmartQuotes
-
public class SmartQuotes extends Object
Replaces straight quotation marks and apostrophes by their typographically correct counterparts.
The code is based on smartquotes.js (https://smartquotes.js.org/) written by Kelly Martin released under the MIT license. It has been translated to Java and extended to support multiple languages.
- Author:
- Michel Kraemer
-
-
Constructor Summary
Constructors Constructor Description SmartQuotes()Creates the smart-quotes parserSmartQuotes(String leftSingleQuote, String rightSingleQuote, String leftDoubleQuote, String rightDoubleQuote, String apostrophe, String prime, String doublePrime, String triplePrime, Locale locale)Creates the smart-quotes parser with custom symbolsSmartQuotes(String leftSingleQuote, String rightSingleQuote, String leftDoubleQuote, String rightDoubleQuote, Locale locale)Creates the smart-quotes parser with custom symbols
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringapply(String str)Replace straight quotation marks and apostrophes in the given string by their typographically correct counterparts.
-
-
-
Constructor Detail
-
SmartQuotes
public SmartQuotes()
Creates the smart-quotes parser
-
SmartQuotes
public SmartQuotes(String leftSingleQuote, String rightSingleQuote, String leftDoubleQuote, String rightDoubleQuote, Locale locale)
Creates the smart-quotes parser with custom symbols- Parameters:
leftSingleQuote- custom left single quotation markrightSingleQuote- custom right singe quotation markleftDoubleQuote- custom left double quotation markrightDoubleQuote- custom right double quotation marklocale- a locale object used to apply special rules and corner cases
-
SmartQuotes
public SmartQuotes(String leftSingleQuote, String rightSingleQuote, String leftDoubleQuote, String rightDoubleQuote, String apostrophe, String prime, String doublePrime, String triplePrime, Locale locale)
Creates the smart-quotes parser with custom symbols- Parameters:
leftSingleQuote- custom left single quotation markrightSingleQuote- custom right singe quotation markleftDoubleQuote- custom left double quotation markrightDoubleQuote- custom right double quotation markapostrophe- custom apostropheprime- custom primedoublePrime- custom double primetriplePrime- custom triple primelocale- a locale object used to apply special rules and corner cases
-
-