Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/keenquotes.git

Add rule for nested quotes cut off

AuthorDave Jarvis <email>
Date2022-03-27 16:55:32 GMT-0700
Commitf7f2d2033918cf997a2fcbfa0b741dbbd113ddae
Parent2a3a402
src/main/java/com/whitemagicsoftware/keenquotes/Parser.java
mClosingSingleQuotes.add( lex2 );
}
+ else if( lex1.isType( DASH ) &&
+ lex2.isType( QUOTE_SINGLE ) &&
+ lex3.isType( QUOTE_DOUBLE ) ) {
+ // Example: ---'"
+ consumer.accept( new Token( QUOTE_CLOSING_SINGLE, lex2 ) );
+ mClosingSingleQuotes.add( lex2 );
+ }
else if( lex2.isType( QUOTE_SINGLE, QUOTE_DOUBLE ) ) {
// After tokenizing, the parser will attempt to resolve ambiguities.
src/test/resources/com/whitemagicsoftware/keenquotes/smartypants.txt
&ldquo;Not much o&apos; fellow-creaturs, I think, Miss; all I know—my old master, as war a knowin&apos; man, used to say, says he, &lsquo;If e&apos;er I sow my wheat wi&apos;out brinin&apos;, I&apos;m a Dutchman,&rsquo; says he; an&apos; that war as much as to say as a Dutchman war a fool, or next door. Nay, nay, I aren&apos;t goin&apos; to bother mysen about Dutchmen. There&apos;s fools enoo, an&apos; rogues enoo, wi&apos;out lookin&apos; i&apos; books for &apos;em.&rdquo;
+Computer says, "'It is mysteries---'"
+Computer says, &ldquo;&lsquo;It is mysteries---&rsquo;&rdquo;
+
# ########################################################################
# Ambiguous (no solution)
Delta10 lines added, 0 lines removed, 10-line increase