Hyoki::Document
Inherits Struct < Value < Object
Constants
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
new(source_ios : Array(IO), mecab_dict_dir = nil)
Sourcenew(string : String, mecab_dict_dir = nil)
SourceInstance methods
excerpt(morpheme, context_length, highlight = nil)
Sourceheteronyms(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, &)
Sourceitems_to_text(items, excerpt_context_length, highlight, &)
Sourceitems_to_tsv(items, excerpt_context_length, highlight, header, &)
Sourcelines
Sourcemarkup_as_markdown_inline_code(string)
Sourcereport(type = ReportType::Variants, format = ReportFormat::Text, excerpt_context_length = 5, sort_order = SortOrder::Alphabetical, highlight = false, header = nil, exclude_ascii_only_items = false)
Sourcereport_heteronyms(format, excerpt_context_length, sort_order, highlight, header, exclude_ascii_only_items)
Sourcereport_variants(format, excerpt_context_length, sort_order, highlight, header, exclude_ascii_only_items)
Sourcevariants(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.