diff options
author | Martin Czygan <martin.czygan@gmail.com> | 2021-07-10 00:20:02 +0200 |
---|---|---|
committer | Martin Czygan <martin.czygan@gmail.com> | 2021-07-10 00:20:02 +0200 |
commit | 65f2156c2af3853142825d080d56650f0a1284ce (patch) | |
tree | c516d34059ad787ddf8d694bfef6e1a86b3ad942 /skate | |
parent | 1737eb03e6c7cd5d316ac081a4cea07787ad4429 (diff) | |
download | refcat-65f2156c2af3853142825d080d56650f0a1284ce.tar.gz refcat-65f2156c2af3853142825d080d56650f0a1284ce.zip |
reduce: tweak wiki bref
Diffstat (limited to 'skate')
-rw-r--r-- | skate/reduce.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/skate/reduce.go b/skate/reduce.go index 255f281..823255c 100644 --- a/skate/reduce.go +++ b/skate/reduce.go @@ -167,9 +167,9 @@ func ZippyExactWiki(releases, wiki io.Reader, mr MatchResult, w io.Writer) error return err } var bref BiblioRef - // We use base64 w/o padding of the original PageTitle as - // component for the id. XXX: ok for now? - key := fmt.Sprintf("%s_%s", + // We use lowercase base32 w/o padding of the original + // PageTitle as component for the id. XXX: ok for now? + key := fmt.Sprintf("wikipedia_%s_%s", strings.ToLower(b32enc.EncodeToString([]byte(wiki.PageTitle))), target.Ident) if seen.Contains(key) { @@ -177,7 +177,8 @@ func ZippyExactWiki(releases, wiki io.Reader, mr MatchResult, w io.Writer) error } seen.Add(key) bref.Key = key - bref.SourceWikipediaArticle = wiki.PageTitle + // XXX: We currently only use "en" subset. + bref.SourceWikipediaArticle = fmt.Sprintf("en:%s", wiki.PageTitle) bref.TargetReleaseIdent = target.Ident bref.TargetWorkIdent = target.WorkID bref.MatchProvenance = "wikipedia" |