Guest User

Editing punctuation Find/Replace

a guest
Nov 16th, 2020
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. Find/replace:
  2.  
  3.  
  4. End of sentence: `.`, `?`, `!`
  5. 1. `. ` by `.` (xInf)
  6. 2. `.` by `. `
  7. 3. ` .` by `.` (xInf)
  8.  
  9. Mid sentence: `,`, `;`
  10. 1. `, ` by `,` (xInf)
  11. 2. `,` by `, `
  12. 3. ` ,` by `,` (xInf)
  13.  
  14. Parentheses:
  15. 1. `( ` by `(` (xInf)
  16. 2. ` )` by `)` (xInf)
  17. 3. `) ` by `)` (xInf)
  18. 4. `)` by `) `
  19. 5. `) .` by `).` (Also ?, !)
  20. 6. `) ,` by `),` (Also ;)
  21. 6. ` (` by `(` (xInf) // `. (` needs to be handled better?
  22. 7. `(` by ` (`
  23. 8. `.) ` by `.) ` (Also ?, !)
  24.  
  25. Quotes:
  26. // `"` is not good since it matches both opening and closing quotes.
  27. // hex 2018 = dec 8216 is opening single quote
  28. // hex 2019 = dec 8217 is closing single quote
  29. // hex 201C = dec 8220 is opening double quote
  30. // hex 201D = dec 8221 is closing double quote
  31. // hex 0022 = dec 34 is non-smart quote.
  32. 1. `^u34` by `"`
  33. 2. ` ^u8217` by `'` (xInf)
  34. 3. ` ^u8221` by `"` (xInf) // Problem if multiple spaces: closing replaced by opening.
  35. 4. `^u8216 ` by `'` (xInf)
  36. 5. `^u8220 ` by `"` (xInf)
  37. 6. `.^u8221` by `." ` (Also ?, !)
  38. 7. `,^u8221` by `," ` (Also ;)
  39.  
  40.  
  41. Paragraph breaks:
  42. 1. ` ^p` by `^p` (xInf)
  43.  
  44.  
  45.  
  46. ==========
  47. Yet to address:
  48.  
  49. - Quotes and interaction with fullstops
  50. - Ellipsis
  51. - Abbreviations e.g. M.L.A.
Advertisement
Add Comment
Please, Sign In to add comment