package bidi

Import Path
	vendor/golang.org/x/text/unicode/bidi (on golang.org and go.dev)

Dependency Relation
	imports 5 packages, and imported by 2 packages

Involved Source Files
	d-> bidi.go
	    bracket.go
	    core.go
	    prop.go
	    tables12.0.0.go
	    trieval.go

Exported Type Names

type Class uint Class is the Unicode BiDi class. Each rune has a single class. func Properties.Class() Class const AL const AN const B const BN const Control const CS const EN const ES const ET const FSI const L const LRE const LRI const LRO const NSM const ON const PDF const PDI const R const RLE const RLI const RLO const S const WS
type Direction int A Direction indicates the overall flow of text. func (*Ordering).Direction() Direction func (*Paragraph).Direction() Direction func (*Run).Direction() Direction func vendor/golang.org/x/text/secure/bidirule.Direction(b []byte) Direction func vendor/golang.org/x/text/secure/bidirule.DirectionString(s string) Direction func DefaultDirection(d Direction) Option const LeftToRight const Mixed const Neutral const RightToLeft
type Option (func) An Option is an option for Bidi processing. func DefaultDirection(d Direction) Option func (*Paragraph).SetBytes(b []byte, opts ...Option) (n int, err error) func (*Paragraph).SetString(s string, opts ...Option) (n int, err error)
type Ordering (struct) An Ordering holds the computed visual order of runs of a Paragraph. Calling SetBytes or SetString on the originating Paragraph invalidates an Ordering. The methods of an Ordering should only be called by one goroutine at a time. Direction reports the directionality of the runs. The direction may be LeftToRight, RightToLeft, Mixed, or Neutral. NumRuns returns the number of runs. Run returns the ith run within the ordering. func (*Paragraph).Line(start, end int) (Ordering, error) func (*Paragraph).Order() (Ordering, error)
type Paragraph (struct) A Paragraph holds a single Paragraph for Bidi processing. Direction returns the direction of the text of this paragraph. The direction may be LeftToRight, RightToLeft, Mixed, or Neutral. IsLeftToRight reports whether the principle direction of rendering for this paragraphs is left-to-right. If this returns false, the principle direction of rendering is right-to-left. Line computes the visual ordering of runs for a single line starting and ending at the given positions in the original text. Order computes the visual ordering of all the runs in a Paragraph. RunAt reports the Run at the given position of the input text. This method can be used for computing line breaks on paragraphs. SetBytes configures p for the given paragraph text. It replaces text previously set by SetBytes or SetString. If b contains a paragraph separator it will only process the first paragraph and report the number of bytes consumed from b including this separator. Error may be non-nil if options are given. SetString configures p for the given paragraph text. It replaces text previously set by SetBytes or SetString. If b contains a paragraph separator it will only process the first paragraph and report the number of bytes consumed from b including this separator. Error may be non-nil if options are given.
type Properties (struct) Properties provides access to BiDi properties of runes. Class returns the Bidi class for p. IsBracket reports whether the rune is a bracket. IsOpeningBracket reports whether the rune is an opening bracket. IsBracket must return true. func Lookup(s []byte) (p Properties, sz int) func LookupRune(r rune) (p Properties, size int) func LookupString(s string) (p Properties, sz int)
type Run (struct) A Run is a continuous sequence of characters of a single direction. Bytes returns the text of the run in its original order. Direction reports the direction of the run. Position of the Run within the text passed to SetBytes or SetString of the originating Paragraph value. String returns the text of the run in its original order. *T : expvar.Var *T : fmt.Stringer func (*Ordering).Run(i int) Run func (*Paragraph).RunAt(pos int) Run
Exported Values
const AL Class = 13 // ArabicLetter
const AN Class = 5 // ArabicNumber
func AppendReverse(out, in []byte) []byte AppendReverse reverses the order of characters of in, appends them to out, and returns the result. Modifiers will still follow the runes they modify. Brackets are replaced with their counterparts.
const B Class = 7 // ParagraphSeparator
const BN Class = 11 // BoundaryNeutral
const Control Class = 14 // Control LRO - PDI
const CS Class = 6 // CommonSeparator
func DefaultDirection(d Direction) Option DefaultDirection sets the default direction for a Paragraph. The direction is overridden if the text contains directional characters.
const EN Class = 2 // EuropeanNumber
const ES Class = 3 // EuropeanSeparator
const ET Class = 4 // EuropeanTerminator
const FSI Class = 23 // FirstStrongIsolate
const L Class = 0 // LeftToRight
const LeftToRight Direction = 0 LeftToRight indicates the text contains no right-to-left characters and that either there are some left-to-right characters or the option DefaultDirection(LeftToRight) was passed.
func Lookup(s []byte) (p Properties, sz int) Lookup returns properties for the first rune in s and the width in bytes of its encoding. The size will be 0 if s does not hold enough bytes to complete the encoding.
func LookupRune(r rune) (p Properties, size int) LookupRune returns properties for r.
func LookupString(s string) (p Properties, sz int) LookupString returns properties for the first rune in s and the width in bytes of its encoding. The size will be 0 if s does not hold enough bytes to complete the encoding.
const LRE Class = 18 // LeftToRightEmbedding
const LRI Class = 21 // LeftToRightIsolate
const LRO Class = 16 // LeftToRightOverride
const Mixed Direction = 2 Mixed indicates text contains both left-to-right and right-to-left characters.
const Neutral Direction = 3 Neutral means that text contains no left-to-right and right-to-left characters and that no default direction has been set.
const NSM Class = 12 // NonspacingMark
const ON Class = 10 // OtherNeutral
const PDF Class = 20 // PopDirectionalFormat
const PDI Class = 24 // PopDirectionalIsolate
const R Class = 1 // RightToLeft
func ReverseString(s string) string ReverseString reverses the order of characters in s and returns a new string. Modifiers will still follow the runes they modify. Brackets are replaced with their counterparts.
const RightToLeft Direction = 1 RightToLeft indicates the text contains no left-to-right characters and that either there are some right-to-left characters or the option DefaultDirection(RightToLeft) was passed.
const RLE Class = 19 // RightToLeftEmbedding
const RLI Class = 22 // RightToLeftIsolate
const RLO Class = 17 // RightToLeftOverride
const S Class = 8 // SegmentSeparator
const UnicodeVersion = "12.0.0" UnicodeVersion is the Unicode version from which the tables in this package are derived.
const WS Class = 9 // WhiteSpace