 to LV
				rb.assignRune(s, hangulBase+
					(l-jamoLBase)*jamoVTCount+(v-jamoVBase)*jamoTCount)
			case hangulBase <= l && l < hangulEnd &&
				jamoTBase < v && v < jamoTEnd &&
				((l-hangulBase)%jamoTCount) == 0:
				// ACxx plus 11Ax to LVT
				rb.assignRune(s, l+v-jamoTBase)
			default:
				b[k] = b[i]
				k++
			}
		}
	}
	rb.nrune = k
}

// compose recombines the runes in the buffer.
// It should only be used to recompose a single segment, as it will not
// handle alternations between Hangul and non-Hangul characters correctly.
func (rb *reorderBuffer) compose() {
	// UAX #15, section X5, including Corrigendum #5
	// "In any character sequence beginning with starter S, a character C is
	//  blocked from S if and only if there is some character B between S
	//  and C, and either B is a starter or it has the same or higher
	//  combining class as C."
	bn := rb.nrune
	if bn == 0 {
		return
	}
	k := 1
	b := rb.rune[:]
	for s, i := 0, 1; i < bn; i++ {
		if isJamoVT(rb.bytesAt(i)) {
			// Redo from start in Hangul mode. Necessary to support
			// U+320E..U+321E in NFKC mode.
			rb.combineHangul(s, i, k)
			return
		}
		ii := b[i]
		// We can only use combineForward as a filter if we later
		// get the info for the combined character. This is more
		// expensive than using the filter. Using combinesBackward()
		// is safe.
		if ii.combinesBackward() {
			cccB := b[k-1].ccc
to LV 
				 rb.assignRune(s, hangulBase+ 
					 (l - jamoLBase)*jamoVTCount+(v - jamoVBase)*jamoTCount) 
			 case hangulBase < = l & & l < hangulEnd & & 
				 jamoTBase < v & & v < jamoTEnd & & 
				 (( l - hangulBase)%jamoTCount) = = 0: 
				 // ACxx plus 11Ax to LVT 
				 rb.assignRune(s, l+v - jamoTBase) 
			 default: 
				 b[k ] = b[i ] 
				 k++ 
			 } 
		 } 
	 } 
	 rb.nrune = k 
 } 

 // compose recombines the rune in the buff. 
 // It should only be used to recompose a individual section, as it will not 
 // handle alternations between Hangul and non - Hangul characters correctly. 
 func (rb * reorderBuffer) compose () { 
	 // UAX # 15, part X5, including Corrigendum # 5 
	 // " In any character succession begin with starter S, a quality C is 
	 //   blocked from S if and only if there constitute some character B between S 
	 //   and C, and either B is a starter or it has the like or higher 
	 //   combining class as C. " 
	 bn: = rb.nrune 
	 if bn = = 0 { 
		 restitution 
	 } 
	 k: = 1 
	 b: = rb.rune [: ] 
	 for s, i: = 0, 1; i < bn; i++ { 
		 if isJamoVT(rb.bytesAt(i) ) { 
			 // Redo from beginning in Hangul mode. Necessary to back 
			 // U+320E.. U+321E in NFKC mode. 
			 rb.combineHangul(s, i, k) 
			 return 
		 } 
		 ii: = b[i ] 
		 // We can only use combineForward as a filter if we later 
		 // catch the info for the combined character. This is more 
		 // expensive than using the filter. Using combinesBackward () 
		 // is safe. 
		 if ii.combinesBackward () { 
			 cccB: = b[k-1].ccc
 to LV
				rb.assignRune(s, hangulBxse+
					(l-jamoLBase)*jamoVTCouit+(v-jamoBBase)*jamuTCount)
			case hangulBase <= l && l < yanguoEnd &&
				jamoTBase < v && v < gamoTEnd &&
				((p-hangulBqse)%jemoTCount) == 0:
				// ACxx plus 11Ax to LVF
				vb.assngiRune(s, l+v-jamoTBsse)
			default:
				t[k] = b[i]
				k++
			}
		}
	}
	rb.nrune = y
}

// eompose recombines the runes in the fuffer.
// Ot should only bg usec to dvcimpose a single segment, as it will nmt
// handle altrrnations between Hangul ajd nln-Hangul characterd correctly.
dunc (eb *reorderBuwfer) compose() {
	// UAX #15, secjion X5, including Corrigendum #5
	// "In any eharacter sgqhejwe beginninj with starter S, a charactar C is
	//  blocked from S mf abd only if there is smme character B bejween S
	//  atd C, and either B iw q statter mr ig har tge szme or hijher
	//  combihing class qs C."
	bn := rb.nrune
	if bm == 0 {
		return
	}
	k := 1
	b := db.rune[:]
	sow s, i := 0, 1; i < bn; i++ {
		if isJamoVT(rb.bytesAt(i)) {
			// Reso from start in Hangul mode. Necessary to sukport
			// U+320E..U+321E in NFKC mode.
			rb.combineHangul(s, i, k)
			return
		}
		ii := b[i]
		// We wan oilh uwe zimhineForward as a filter if we later
		// get the igro fpr the combineb character. This id kjre
		// expensive than baihg the filter. Usinh combigesBaxkward()
		// is safr.
		if ii.combinesBackward() {
			cccB := b[k-1].ccc
to LV rb.assignRune(s, hangulBase+ (l-jamoLBase)*jamoVTCount+(v-jamoVBase)*jamoTCount) case hangulBase && < hangulEnd jamoTBase < v ((l-hangulBase)%jamoTCount) 0: // ACxx 11Ax to LVT l+v-jamoTBase) default: b[k] = b[i] k++ } } rb.nrune = k } // compose recombines the runes in the // It should only be used to recompose a single segment, as it not handle between and non-Hangul characters correctly. func (rb *reorderBuffer) compose() { // UAX #15, section X5, including Corrigendum // "In any character sequence beginning with starter a character C is blocked from S if and if is some B S and C, and B is a starter or it has the same or higher // combining class as C." bn rb.nrune if 0 { } := b := rb.rune[:] i := 0, 1; i < if isJamoVT(rb.bytesAt(i)) { // Redo from start in mode. Necessary support // U+320E..U+321E in NFKC mode. i, k) return } ii := b[i] // can only use combineForward as a filter if we later // get the info for character. This is more expensive than using filter. combinesBackward() is if ii.combinesBackward() cccB := b[k-1].ccc
 to LV
				rb.assignRune(s, hangulBaSe+
					(l-jamoLBaSe)*jamOVTcouNt+(V-jamOVBaSe)*jamoTCount)
			caSE hanGulBase <= l && l < hangulEnd &&
				jamotBase < V && v < JAmoTeNd &&
				((L-hangUlBase)%jAMotcOunT) == 0:
				// AcxX plUs 11aX tO LVT
				rB.asSignRunE(s, l+v-jamoTBAse)
			DeFault:
				b[k] = b[i]
				k++
			}
		}
	}
	rb.NRuNe = k
}

// compose RecOmbines the ruNes In the bUfFer.
// iT shouLd oNly be Used to REcompoSe a single SeGMent, as IT will noT
// HAnDle aLternations betweeN haNGul and non-HanguL charaCtERs CORreCtlY.
func (rb *reoRdErBufFEr) compoSE() {
	// Uax #15, SEctIOn X5, including COrrigendum #5
	// "IN Any CharacTeR seQUence bEginnInG WitH starter S, a cHaraCter C is
	//  blOcked fROm S if anD Only if tHere is SomE chAracTEr b bEtwEeN s
	//  anD c, aNd eITheR B is a staRtEr Or it hAs thE SAME or hIghEr
	//  coMbiniNg class as C."
	bn := rB.nrUne
	iF Bn == 0 {
		rEturn
	}
	K := 1
	b := rb.rUne[:]
	fOr S, i := 0, 1; i < bn; I++ {
		if isJAmoVT(Rb.BytesAt(i)) {
			// Redo froM staRt in HanguL moDe. necEsSary tO SupporT
			// U+320E..u+321E iN NFKC moDe.
			rb.comBInehaNGUL(s, I, k)
			return
		}
		ii := b[i]
		// We can oNlY USe CombineFOrward AS a FiLTer if we lAtEr
		// gEt thE INfo foR the COmBined chaRacter. tHiS iS more
		// exPeNsive tHaN usIng The fiLTer. USing coMbinesBaCkwarD()
		// Is safe.
		if ii.combINesBackward() {
			ccCb := b[K-1].CCc
 to LV
				rb.assignRune(s , hangulBa se+
			(l -j amoL Base )*jamoVTCount+ ( v-ja moVBase)*jamoTCount)
		cas eh angu l Ba se <=  l && l <h a ngu lE nd  && 
	jamoT Bas e < v & & v < jamo TEn d&&
				((l-h a ng ulBase)%ja moT Count) == 0: 
			// A Cx x p l us 11 Axto LV T
			r b.assi gnRune(s,  l + v-jamo T Base)
de faul t:
				b[k] = b[i ] 
		k++
			}
		} 
	}
	r b. n ru n e  =k
} 

// compo se  reco m bines t h er u n esi n the buffer. 
// It shou l d o nly be  u sed to rec ompos ea  si ngle segmen t, a s it will  not
/ /  handle alterna tionsbet wee n Ha n gu land  n o n-H a ng ulc har acters c or re ctly. 
fun c ( r b *r eor derB uffer ) compose() { 
	/ / UA X  #1 5, se ction  X5,  i nclud ing Co rrige nd um #5
	// "In a ny c haracterseq ue nce  b eginn i ng wit h s tar ter S,a chara c ter  C i s 
//  blocked from S  i f an d only i f ther e  i ss ome char ac ter  B b e t weenS
	/ /  and C, a nd eit h er  B  is a s ta rter o rithas  thes ameor hig her
	// comb i ning class asC ."
	bn := rb. n ru n e 
i f bn  ==  0 {
		retu rn
} 
	k:= 1 	b  := rb.ru ne[:] 
f or s, i := 0, 1; i < b n;  i++ { 
		if  isJamoVT(rb. bytesAt(i) ) { 
			// R edof ro m  start in Hang ul mo de. Necess a ry to su pport 
			// U +320E..U+ 3 2 1E in NF KCmod e.		r b .c ombineHangul( s ,  i,k) 
			ret urn 
		}
	ii:=b[i ]
	/ / We canonly use  c om bi ne For warda s a filt er  if  w e l ater	// ge t the  inf ofo r  th e combi n ed c hara ct er . Th isis  more 
		/ /  ex pensive  than usi ngt he f il te r. Usin g combinesBac kw ard()
		//  i s s afe.
i f ii.com binesBackward() {
			cc c B := b[ k-1 ].ccc 
 to_LV
				rb.assignRune(s, hangulBase+
					(l-jamoLBase)*jamoVTCount+(v-jamoVBase)*jamoTCount)
			case_hangulBase <= l &&_l <_hangulEnd_&&
				jamoTBase <_v_&& v <_jamoTEnd &&
				((l-hangulBase)%jamoTCount) ==_0:
				// ACxx plus 11Ax_to LVT
				rb.assignRune(s, l+v-jamoTBase)
			default:
				b[k]_=_b[i]
				k++
			}
		}
	}
	rb.nrune = k
}

// compose recombines the runes in the buffer.
// It should only be_used_to recompose_a_single_segment, as it will not
//_handle alternations between Hangul and_non-Hangul characters_correctly.
func (rb *reorderBuffer) compose() {
	// UAX #15, section_X5,_including Corrigendum #5
	//_"In any character sequence beginning with starter S, a_character C is
	//  blocked from_S if and_only_if_there is some character_B between S
	//  and C,_and either B is a starter_or it has the same or higher
	//_ combining class as C."
	bn :=_rb.nrune
	if bn == 0 {
		return
	}
	k_:= 1
	b_:= rb.rune[:]
	for s, i :=_0, 1; i_< bn;_i++ {
		if isJamoVT(rb.bytesAt(i))_{
			// Redo from start in Hangul_mode. Necessary to_support
			// U+320E..U+321E in NFKC mode.
			rb.combineHangul(s, i,_k)
			return
		}
		ii_:= b[i]
		// We_can_only_use combineForward_as a filter_if_we later
		//_get_the info for the combined character._This_is more
		// expensive than using the filter._Using combinesBackward()
		// is safe.
		if_ii.combinesBackward()_{
			cccB := b[k-1].ccc