struct

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)
Source
new(string : String, mecab_dict_dir = nil)
Source

Instance methods

excerpt(morpheme, context_length, highlight = nil)
Source
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.

Source
items_to_markdown(items, excerpt_context_length, highlight, &)
Source
items_to_text(items, excerpt_context_length, highlight, &)
Source
items_to_tsv(items, excerpt_context_length, highlight, header, &)
Source
lines
Source
markup_as_markdown_inline_code(string)
Source
report(type = ReportType::Variants, format = ReportFormat::Text, excerpt_context_length = 5, sort_order = SortOrder::Alphabetical, highlight = false, header = nil, exclude_ascii_only_items = false)
Source
report_heteronyms(format, excerpt_context_length, sort_order, highlight, header, exclude_ascii_only_items)
Source
report_variants(format, excerpt_context_length, sort_order, highlight, header, exclude_ascii_only_items)
Source
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.

Source

Nested types