From 87ff9eb5dd33719c3947034ea4695c3e27ba6f9d Mon Sep 17 00:00:00 2001 From: Martin Czygan Date: Tue, 27 Apr 2021 10:09:02 +0200 Subject: add prefix wrapper --- skate/cmd/skate-map/main.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'skate/cmd/skate-map') diff --git a/skate/cmd/skate-map/main.go b/skate/cmd/skate-map/main.go index ffe1017..94cf606 100644 --- a/skate/cmd/skate-map/main.go +++ b/skate/cmd/skate-map/main.go @@ -27,18 +27,18 @@ func main() { // XXX: introduce prefixes availableMappers := map[string]skate.Mapper{ "id": skate.Identity, - "ff": skate.CreateFixedMapper(*extraValue), - "title": skate.MapperTitle, - "tnorm": skate.MapperTitleNormalized, - "tnysi": skate.MapperTitleNysiis, - "tsand": skate.MapperTitleSandcrawler, + "field": skate.WithPrefix(skate.CreateFixedMapper(*extraValue), "field"), + "title": skate.WithPrefix(skate.MapperTitle, "title"), + "tnorm": skate.WithPrefix(skate.MapperTitleNormalized, "tnorm"), + "tnysi": skate.WithPrefix(skate.MapperTitleNysiis, "tnysi"), + "tsand": skate.WithPrefix(skate.MapperTitleSandcrawler, "tsand"), } switch { case *mapperName != "": if f, ok := availableMappers[*mapperName]; !ok { log.Fatalf("unknown mapper name: %v", *mapperName) } else { - pp := parallel.NewProcessor(os.Stdin, os.Stdout, f.TSV) + pp := parallel.NewProcessor(os.Stdin, os.Stdout, f.AsTSV) pp.NumWorkers = *numWorkers pp.BatchSize = *batchSize pp.Verbose = *verbose -- cgit v1.2.3