Browse Source

russian :)

master
misterzym 6 years ago committed by GitHub
parent
commit
75a92e204a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      parser.go

10
parser.go

@ -46,20 +46,20 @@ var ELEMENT_TYPE_TO_TYPE_EVALUATORS = map[ElementType][]TypeEvaluator{
func parseIndex(indexFilePath string, entryHandler func(IndexEntry)) { func parseIndex(indexFilePath string, entryHandler func(IndexEntry)) {
log.Info("Indexing from file", "file", indexFilePath) log.Info("Индексация файла", "file", indexFilePath)
indexed := 0 indexed := 0
file, err := os.OpenFile(indexFilePath, os.O_RDONLY, 0666) file, err := os.OpenFile(indexFilePath, os.O_RDONLY, 0666)
if err != nil { if err != nil {
log.Error("Unable to open file", "file", indexFilePath, "error", err) log.Error("Нельзя открыть файл", "file", indexFilePath, "error", err)
return return
} }
root, err := html.Parse(file) root, err := html.Parse(file)
if err != nil { if err != nil {
log.Error("Unable to parse index", "file", file, "error", err) log.Error("Нельзя создать индекс файла", "file", file, "error", err)
return return
} }
@ -123,7 +123,7 @@ func parseIndex(indexFilePath string, entryHandler func(IndexEntry)) {
} }
if tagType == NotFound { if tagType == NotFound {
log.Warn("Warning: could not determine type", "text", text, "dtClassName", dtClassName) log.Warn("Предупреждение: неизвестный тип", "text", text, "dtClassName", dtClassName)
continue continue
} }
@ -135,7 +135,7 @@ func parseIndex(indexFilePath string, entryHandler func(IndexEntry)) {
indexed++ indexed++
} }
log.Info("Indexed", "count", indexed) log.Info("Проиндексировано", "count", indexed)
} }
func NewTypeEvaluators(a TypeEvaluator, others ...TypeEvaluator) []TypeEvaluator { func NewTypeEvaluators(a TypeEvaluator, others ...TypeEvaluator) []TypeEvaluator {

Loading…
Cancel
Save