Unify the newRecognizer function naming convention

This commit is contained in:
Sheng Yu 2012-08-14 15:31:14 -07:00
Родитель 5c9192840e
Коммит e19ac938c6
3 изменённых файлов: 19 добавлений и 7 удалений

Просмотреть файл

@ -17,11 +17,11 @@ type Detector struct {
// List of charset recognizers
var recognizers = []recognizer{
new(recognizerUtf8),
new(recognizerUtf16be),
new(recognizerUtf16le),
newRecognizerUtf32be(),
newRecognizerUtf32le(),
newRecognizer_utf8(),
newRecognizer_utf16be(),
newRecognizer_utf16le(),
newRecognizer_utf32be(),
newRecognizer_utf32le(),
newRecognizer_8859_1_en(),
newRecognizer_8859_1_da(),
newRecognizer_8859_1_de(),

Просмотреть файл

@ -14,6 +14,10 @@ var (
type recognizerUtf16be struct {
}
func newRecognizer_utf16be() *recognizerUtf16be {
return &recognizerUtf16be{}
}
func (*recognizerUtf16be) Match(input *recognizerInput) (output recognizerOutput) {
output = recognizerOutput{
Charset: "UTF-16BE",
@ -27,6 +31,10 @@ func (*recognizerUtf16be) Match(input *recognizerInput) (output recognizerOutput
type recognizerUtf16le struct {
}
func newRecognizer_utf16le() *recognizerUtf16le {
return &recognizerUtf16le{}
}
func (*recognizerUtf16le) Match(input *recognizerInput) (output recognizerOutput) {
output = recognizerOutput{
Charset: "UTF-16LE",
@ -51,7 +59,7 @@ func decodeUtf32le(input []byte) rune {
return rune(input[3]<<24 | input[2]<<16 | input[1]<<8 | input[0])
}
func newRecognizerUtf32be() *recognizerUtf32 {
func newRecognizer_utf32be() *recognizerUtf32 {
return &recognizerUtf32{
"UTF-32BE",
utf32beBom,
@ -59,7 +67,7 @@ func newRecognizerUtf32be() *recognizerUtf32 {
}
}
func newRecognizerUtf32le() *recognizerUtf32 {
func newRecognizer_utf32le() *recognizerUtf32 {
return &recognizerUtf32{
"UTF-32LE",
utf32leBom,

Просмотреть файл

@ -9,6 +9,10 @@ var utf8Bom = []byte{0xEF, 0xBB, 0xBF}
type recognizerUtf8 struct {
}
func newRecognizer_utf8() *recognizerUtf8 {
return &recognizerUtf8{}
}
func (*recognizerUtf8) Match(input *recognizerInput) (output recognizerOutput) {
output = recognizerOutput{
Charset: "UTF-8",