Documentation
¶
Index ¶
- Variables
- func AllowedCollectionNames(is finc.IntermediateSchema) error
- func KeyLength(is finc.IntermediateSchema) error
- func NoCurrencyInTitle(is finc.IntermediateSchema) error
- func NoExcessivePuctuation(is finc.IntermediateSchema) error
- func PlausibleDate(is finc.IntermediateSchema) error
- func PlausiblePageCount(is finc.IntermediateSchema) error
- func SubtitleRepetition(is finc.IntermediateSchema) error
- func ValidURL(is finc.IntermediateSchema) error
- type DelegatingRecordTester
- type Kind
- type QualityIssue
- type RecordTester
- type TestSuite
Constants ¶
This section is empty.
Variables ¶
var ( // EarliestDate is the earliest publication date we accept. EarliestDate = time.Date(1458, 1, 1, 0, 0, 0, 0, time.UTC) // LatestDate represents the latest publication date we accept. LatestDate = time.Now().AddDate(5, 0, 0) // AllowedCollections AllowedCollections = assetutil.MustLoadStringSet("assets/collections/collections.tsv", "assets/collections/crossref.tsv") )
var DefaultTests = []RecordTester{ RecordTesterFunc(KeyLength), RecordTesterFunc(PlausiblePageCount), RecordTesterFunc(ValidURL), RecordTesterFunc(PlausibleDate), RecordTesterFunc(AllowedCollectionNames), RecordTesterFunc(SubtitleRepetition), RecordTesterFunc(NoCurrencyInTitle), RecordTesterFunc(NoExcessivePuctuation), }
Functions ¶
func AllowedCollectionNames ¶
func AllowedCollectionNames(is finc.IntermediateSchema) error
AllowedCollectionNames checks for a fixed list of allowed collection names, stored under assets, refs. #6496.
func KeyLength ¶
func KeyLength(is finc.IntermediateSchema) error
KeyLength checks the length of the record id. memcachedb limits this to 250 bytes.
func NoCurrencyInTitle ¶
func NoCurrencyInTitle(is finc.IntermediateSchema) error
NoCurrencyInTitle, e.g. http://goo.gl/HACBcW Cartier , Marie . Baby, You Are My Religion: Women, Gay Bars, and Theology Before Stonewall . Gender, Theology and Spirituality. Durham, UK: Acumen, 2013. xii+256 pp. $90.00 (cloth); $29.95 (paper).
func NoExcessivePuctuation ¶
func NoExcessivePuctuation(is finc.IntermediateSchema) error
NoExcessivePuctuation should detect things like this title: CrossRef????????????? https://goo.gl/AD0V1o
func PlausibleDate ¶
func PlausibleDate(is finc.IntermediateSchema) error
PlausibleDate checks for suspicious dates, refs. #5686.
func PlausiblePageCount ¶
func PlausiblePageCount(is finc.IntermediateSchema) error
PlausiblePageCount checks, wether the start and end page look plausible.
func SubtitleRepetition ¶
func SubtitleRepetition(is finc.IntermediateSchema) error
SubtitleRepetition, refs #6553.
func ValidURL ¶
func ValidURL(is finc.IntermediateSchema) error
ValidURL checks, if a URL string is parseable.
Types ¶
type DelegatingRecordTester ¶
type DelegatingRecordTester struct {
// contains filtered or unexported fields
}
DelegatingRecordTester delegates testing to a passed in function.
func (DelegatingRecordTester) TestRecord ¶
func (t DelegatingRecordTester) TestRecord(is finc.IntermediateSchema) error
TestRecord fulfills the interface.
type QualityIssue ¶
type QualityIssue struct {
Kind Kind
Record finc.IntermediateSchema
Message string
}
func (QualityIssue) Error ¶
func (e QualityIssue) Error() string
func (QualityIssue) TSV ¶
func (e QualityIssue) TSV() string
type RecordTester ¶
type RecordTester interface {
TestRecord(finc.IntermediateSchema) error
}
RecordTester is a intermediate record checker.
func RecordTesterFunc ¶
func RecordTesterFunc(tester func(finc.IntermediateSchema) error) RecordTester
RecordTesterFunc turns any function into a RecordTester. TODO(miku): convert RecordTesterFunc to type