RubyTextBracketParser class

A parser for bracket-style ruby text annotations.

This parser supports two annotation formats:

Single character format: char[ruby]

  • Example: 煮[zhǔ]豆[dòu]持[chí]
  • Each character is followed by its ruby annotation in square brackets

Grouped format: (base)[ruby]

  • Example: (九州)[きゅうしゅう]
  • Multiple characters are grouped in parentheses with a single ruby annotation

Both formats can be mixed in the same input string. Plain text without annotations is also supported.

Example usage:

const parser = RubyTextBracketParser();
final words = parser.parse('Hello (世界)[せかい]!');
Implemented types

Constructors

RubyTextBracketParser()
Creates a bracket-style ruby text parser.
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parse(String input) → List<RubyTextWord>
Parses the input string and returns a list of RubyTextWord objects.
override
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited