func ParseRangeTable(property Property, data []byte) *unicode.RangeTable {
	propRegexp := hasPropertyRegexp(property)

	var r16s []unicode.Range16
	var r32s []unicode.Range32

	scanner := bufio.NewScanner(bytes.NewReader(data))
	for scanner.Scan() {
		line := scanner.Text()
		if strings.HasPrefix(line, "#") || strings.TrimSpace(line) == "" {
			continue
		}
		if !propRegexp.MatchString(line) {
			continue
		}
		start, end, ok := toRange(line)
		if !ok {
			continue
		}
		r16, err := parseRange16(start, end)
		if err == nil {
			r16s = append(r16s, *r16)
			continue
		}
		r32, err := parseRange32(start, end)
		if err == nil {
			r32s = append(r32s, *r32)
		}
	}

	latinOffset := 0
	for _, r16 := range r16s {
		if r16.Hi <= unicode.MaxLatin1 {
			latinOffset++
		}
	}

	rt := unicode.RangeTable{
		R16:         r16s,
		R32:         r32s,
		LatinOffset: latinOffset,
	}
	return &rt
}
// ParseRangeTable parses the specified Unicode.org data file for characters with the
// specified property, and returns a range table of those characters.
//
// Note that the range table reflects the ranges as defined in the source files; ranges
// are guaranteed not to overlap, as per the RangeTable docs, but adjacent ranges are not
// coalesced.
ParseRangeTable parses the specified Unicode.org data file for characters with the
specified property, and returns a range table of those characters.

Note that the range table reflects the ranges as defined in the source files; ranges
are guaranteed not to overlap, as per the RangeTable docs, but adjacent ranges are not
coalesced.
// ParseRangeTable parses the specified Unicode . org data file for characters with the // specified property and returns a range table of those characters . // // Note that the range table reflects the ranges as defined in the source files ; ranges // are guaranteed not to overlap as per the RangeTable docs but adjacent ranges are not // coalesced .
func ParseRangeTable(property Property, data []byte) *unicode.RangeTable {
	propRegexp := hasPropertyRegexp(property)
	var r16s []unicode.Range16
	var r32s []unicode.Range32
	scanner := bufio.NewScanner(bytes.NewReader(data))
	for scanner.Scan() {
		line := scanner.Text()
		if strings.HasPrefix(line, "#") || strings.TrimSpace(line) == "" {
			continue
		}
		if !propRegexp.MatchString(line) {
			continue
		}
		start, end, ok := toRange(line)
		if !ok {
			continue
		}
		r16, err := parseRange16(start, end)
		if err == nil {
			r16s = append(r16s, *r16)
			continue
		}
		r32, err := parseRange32(start, end)
		if err == nil {
			r32s = append(r32s, *r32)
		}
	}
	latinOffset := 0
	for _, r16 := range r16s {
		if r16.Hi <= unicode.MaxLatin1 {
			latinOffset++
		}
	}
	rt := unicode.RangeTable{
		R16:         r16s,
		R32:         r32s,
		LatinOffset: latinOffset,
	}
	return &rt
}
func ParseRangeTable ( property Property , data [ ] byte ) * unicode . RangeTable { propRegexp := hasPropertyRegexp ( property ) var r16s [ ] unicode . Range16 var r32s [ ] unicode . Range32 scanner := bufio . NewScanner ( bytes . NewReader ( data ) ) for scanner . Scan ( ) { line := scanner . Text ( ) if strings . HasPrefix ( line , " " ) || strings . TrimSpace ( line ) == " " { continue } if ! propRegexp . MatchString ( line ) { continue } start , end , ok := toRange ( line ) if ! ok { continue } r16 , err := parseRange16 ( start , end ) if err == nil { r16s = append ( r16s , * r16 ) continue } r32 , err := parseRange32 ( start , end ) if err == nil { r32s = append ( r32s , * r32 ) } } latinOffset := 0 for _ , r16 := range r16s { if r16 . Hi <= unicode . MaxLatin1 { latinOffset ++ } } rt := unicode . RangeTable { R16 : r16s , R32 : r32s , LatinOffset : latinOffset , } return & rt }
ParseRangeTable parses the specified Unicode.org data file for characters with the
specified property, and returns a range table of those characters.
ParseRangeTable parses the specified Unicode . org data file for characters with the specified property and returns a range table of those characters .