class

Cadmium::PragmaticTokenizer::Languages::Common

Inherits Reference / Object

Constants

ABBREVIATIONS = Set(String).new
ALNUM_QUOTE = /(\w|\D)'(?!')(?=\W|$)/

Single quotes handling

CONTRACTIONS = {} of String => String
PUNCTUATION_MAP = {"。" => "♳", "." => "♴", "." => "♵", "!" => "♶", "!" => "♷", "?" => "♸", "?" => "♹", "、" => "♺", "¡" => "⚀", "¿" => "⚁", "„" => "⚂", "“" => "⚃", "[" => "⚄", "]" => "⚅", "\"" => "☇", "#" => "☈", "$" => "☉", "%" => "☊", "&" => "☋", "(" => "☌", ")" => "☍", "*" => "☠", "+" => "☢", "," => "☣", ":" => "☤", ";" => "☥", "<" => "☦", "=" => "☧", ">" => "☀", "@" => "☁", "^" => "☂", "_" => "☃", "`" => "☄", "'" => "☮", "{" => "♔", "|" => "♕", "}" => "♖", "~" => "♗", "-" => "♘", "«" => "♙", "»" => "♚", "”" => "⚘", "‘" => "⚭"}
QUOTE_NOT_TWAS1 = /(\W|^)'(?!twas)/i
QUOTE_NOT_TWAS2 = /(\W|^)‘(?!twas)/i
QUOTE_WORD = /(\W|^)'(?=\w)/
STOP_WORDS = Set(String).new

Class methods

abbreviations
Source
contractions
Source
handle_single_quotes(text)

This 'special treatment' is actually relevant for many other tests. Alter core regular expressions!

Source
punctuation_map
Source
stop_words
Source