aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--skate/verify.go15
-rw-r--r--skate/verify_test.go2
2 files changed, 11 insertions, 6 deletions
diff --git a/skate/verify.go b/skate/verify.go
index 40ee4e2..5eccbab 100644
--- a/skate/verify.go
+++ b/skate/verify.go
@@ -158,7 +158,7 @@ func ClusterVerifyMaxSize(p []byte, maxClusterSize int) ([]byte, error) {
matchPair := &MatchPair{
A: a.Ident,
B: b.Ident,
- Result: Verify(a, b, 5),
+ Result: Verify(a, b),
}
if _, err := io.WriteString(&buf, matchPair.AsLine()); err != nil {
return nil, err
@@ -196,7 +196,7 @@ func RefClusterVerify(p []byte) ([]byte, error) {
matchPair := &MatchPair{
A: pivot.Ident,
B: re.Ident,
- Result: Verify(pivot, re, 5),
+ Result: Verify(pivot, re),
}
if _, err := io.WriteString(&buf, matchPair.AsLine()); err != nil {
return nil, err
@@ -223,7 +223,7 @@ func RefClusterToBiblioRef(p []byte) ([]byte, error) {
if re.Extra.Skate.Status != "ref" {
continue
}
- result := Verify(pivot, re, 5)
+ result := Verify(pivot, re)
switch result.Status {
case StatusExact, StatusStrong:
if result.Reason == ReasonDOI {
@@ -372,7 +372,7 @@ func ZipVerifyRefs(releases, refs io.Reader, w io.Writer) error {
if err != nil {
return err
}
- result := Verify(pivot, re, 5)
+ result := Verify(pivot, re)
switch result.Status {
case StatusExact, StatusStrong:
if result.Reason == ReasonDOI {
@@ -417,10 +417,15 @@ func stringToWiki(s string) (r *MinimalCitations, err error) {
return
}
+// Verify verifies two releases and will ignore short titles.
+func Verify(a, b *Release) MatchResult {
+ return VerifyMinTitleLength(a, b, 5)
+}
+
// Verify follows the fuzzycat (Python) implementation of this function: it
// compares two release entities. The Go version can be used for large batch
// processing (where the Python version might take two or more days).
-func Verify(a, b *Release, minTitleLength int) MatchResult {
+func VerifyMinTitleLength(a, b *Release, minTitleLength int) MatchResult {
if a.ExtIDs.DOI != "" && a.ExtIDs.DOI == b.ExtIDs.DOI {
return MatchResult{StatusExact, ReasonDOI}
}
diff --git a/skate/verify_test.go b/skate/verify_test.go
index 519fcb5..350a0cc 100644
--- a/skate/verify_test.go
+++ b/skate/verify_test.go
@@ -67,7 +67,7 @@ func TestVerify(t *testing.T) {
if err != nil {
t.Errorf("could not load release: %s", a)
}
- result := Verify(ar, br, 5)
+ result := Verify(ar, br)
if !statusEquals(result.Status.String(), status) {
t.Errorf("%s %s: got %s (%s), want %s (%s) ", a, b, result.Status, result.Reason, status, reason)
}