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.
| Modifier and Type | Field and Description |
|---|---|
| private static final String | |
| private static final String | |
| private static final String | |
| private static final String | |
| private static final String | |
| private static final String | |
| private static final String | |
| private final Pattern[] | |
| private static final String | |
| private final String[] | |
| private static final String | |
| private static final String | |
| private static final String | |
| private static final String |
| Access | Constructor and Description |
|---|---|
| public | |
| public | SmartQuotes(String
custom left single quotation mark leftSingleQuote, String custom right singe quotation mark rightSingleQuote, String custom left double quotation mark leftDoubleQuote, String custom right double quotation mark rightDoubleQuote, Locale a locale object used to apply special rules and corner cases locale)Creates the smart-quotes parser with custom symbols |
| public | SmartQuotes(String
custom left single quotation mark leftSingleQuote, String custom right singe quotation mark rightSingleQuote, String custom left double quotation mark leftDoubleQuote, String custom right double quotation mark rightDoubleQuote, String custom apostrophe apostrophe, String custom prime prime, String custom double prime doublePrime, String custom triple prime triplePrime, Locale a locale object used to apply special rules and corner cases locale)Creates the smart-quotes parser with custom symbols |
| Modifier and Type | Method and Description |
|---|---|
| public String |
| DOUBLE_PRIME | back to summary |
|---|---|
| private static final String DOUBLE_PRIME | |
| LEFT_DOUBLE_QUOTE | back to summary |
|---|---|
| private static final String LEFT_DOUBLE_QUOTE | |
| LEFT_SINGLE_QUOTE | back to summary |
|---|---|
| private static final String LEFT_SINGLE_QUOTE | |
| LETTER | back to summary |
|---|---|
| private static final String LETTER | |
| NO_NUMBER | back to summary |
|---|---|
| private static final String NO_NUMBER | |
| NO_WORD | back to summary |
|---|---|
| private static final String NO_WORD | |
| NUMBER | back to summary |
|---|---|
| private static final String NUMBER | |
| patterns | back to summary |
|---|---|
| private final Pattern[] patterns | |
| PRIME | back to summary |
|---|---|
| private static final String PRIME | |
| replacements | back to summary |
|---|---|
| private final String[] replacements | |
| RIGHT_DOUBLE_QUOTE | back to summary |
|---|---|
| private static final String RIGHT_DOUBLE_QUOTE | |
| RIGHT_SINGLE_QUOTE | back to summary |
|---|---|
| private static final String RIGHT_SINGLE_QUOTE | |
| TRIPLE_PRIME | back to summary |
|---|---|
| private static final String TRIPLE_PRIME | |
| WORD | back to summary |
|---|---|
| private static final String WORD | |
| SmartQuotes | back to summary |
|---|---|
| public SmartQuotes() Creates the smart-quotes parser | |
| SmartQuotes | back to summary |
|---|---|
| public SmartQuotes(String leftSingleQuote, String rightSingleQuote, String leftDoubleQuote, String rightDoubleQuote, Locale locale) Creates the smart-quotes parser with custom symbols
| |
| SmartQuotes | back to summary |
|---|---|
| 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
| |
| apply | back to summary |
|---|---|
| public String apply(String str) Replace straight quotation marks and apostrophes in the given string by their typographically correct counterparts. | |