struct
Hyoki::Document
- Hyoki::Document
- Struct
- Value
- Object
Defined in:
hyoki.crConstant Summary
-
ASCII_WORD_REGEX =
/\A[[:ascii:]]+\z/ -
LINE_REGEX =
/([^\r\n]*?)(\r\n|\r|\n)|(.+)/ -
TSV_ESCAPE =
{"\n" => "\\n", "\t" => "\\t", "\r" => "\\r", "\\" => "\\\\"} -
TSV_ESCAPE_REGEX =
Regex.new(TSV_ESCAPE.keys.map do |k| "(?:#{Regex.escape(k)})" end.join("|")) -
TSV_HEADER_HETERONYMS =
["surface", "source", "line", "character", "yomi", "surface", "excerpt"].join("\t") -
TSV_HEADER_VARIANTS =
["lexical form yomi", "source", "line", "character", "lexical form", "surface", "excerpt"].join("\t")
Constructors
Instance Method Summary
- #excerpt(morpheme, context_length, highlight = nil)
-
#heteronyms(lines, sort_order, exclude_ascii_only_items) : ReportItems
Returns an associative list of surface expression to heteronyms: words with same spelling and different pronunciation.
- #items_to_markdown(items, excerpt_context_length, highlight, &)
- #items_to_text(items, excerpt_context_length, highlight, &)
- #items_to_tsv(items, excerpt_context_length, highlight, header, &)
- #lines : Array(Hyoki::Document::Line)
- #markup_as_markdown_inline_code(string)
- #report(type = ReportType::Variants, format = ReportFormat::Text, excerpt_context_length = 5, sort_order = SortOrder::Alphabetical, highlight = false, header = nil, exclude_ascii_only_items = false)
- #report_heteronyms(format, excerpt_context_length, sort_order, highlight, header, exclude_ascii_only_items)
- #report_variants(format, excerpt_context_length, sort_order, highlight, header, exclude_ascii_only_items)
-
#variants(lines, yomi_parser, sort_order, exclude_ascii_only_items) : ReportItems
Returns an associative list of yomi (of dictionary form) to variants: words with same pronunciation and different spelling.
Constructor Detail
Instance Method Detail
def heteronyms(lines, sort_order, exclude_ascii_only_items) : ReportItems
#
Returns an associative list of surface expression to heteronyms: words with same spelling and different pronunciation.
def report(type = ReportType::Variants, format = ReportFormat::Text, excerpt_context_length = 5, sort_order = SortOrder::Alphabetical, highlight = false, header = nil, exclude_ascii_only_items = false)
#
def report_heteronyms(format, excerpt_context_length, sort_order, highlight, header, exclude_ascii_only_items)
#
def report_variants(format, excerpt_context_length, sort_order, highlight, header, exclude_ascii_only_items)
#
def variants(lines, yomi_parser, sort_order, exclude_ascii_only_items) : ReportItems
#
Returns an associative list of yomi (of dictionary form) to variants: words with same pronunciation and different spelling.