Source File
normalize.go
Belonging Package
github.com/google/licensecheck/old
package old
import (
)
const (
blankID = -1
unknownWordID = -2
)
var htmlesc = strings.NewReplacer(
"“", " \" ",
"”", " \" ",
"&", " & ",
)
if !isWordChar() {
continue
for < len() {
()
if !isWordChar() {
-= // Will skip r next time around.
break
}
}
if - > maxListMarkerLength || !isListMarker([:], ) { // If at EOF, r will not be valid punctuation
:= [:]
, := .dict[]
if ! {
if {
= int32(len(.words))
.words = append(.words, )
.dict[] =
} else {
= unknownWordID
}
}
= append(, )
= append(, int32())
}
}
}
return &document{
text: ,
words: ,
byteOff: ,
}
}
func ( rune) bool {
return unicode.IsLetter()
}
const maxListMarkerLength = 4
var listMarker = func() map[string]bool {
const = "a b c d e f g h i j k l m n o p q r ii iii iv vi vii viii ix xi xii xiii xiv xv"
:= map[string]bool{}
for , := range strings.Split(, " ") {
if len() > maxListMarkerLength {
panic("marker too long")
}
[] = true
}
return
}()
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |