Documentation ¶
Index ¶
- Variables
- func AllowedCollectionNames(is finc.IntermediateSchema) error
- func FeasibleAuthor(is finc.IntermediateSchema) error
- func HasPublisher(is finc.IntermediateSchema) error
- func HasURL(is finc.IntermediateSchema) error
- func KeyLength(is finc.IntermediateSchema) error
- func NoCurrencyInTitle(is finc.IntermediateSchema) error
- func NoExcessivePunctuation(is finc.IntermediateSchema) error
- func NoRepeatedSlash(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 Issue
- type Kind
- type TestSuite
- type Tester
- type TesterFunc
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 = []Tester{ TesterFunc(KeyLength), TesterFunc(PlausiblePageCount), TesterFunc(ValidURL), TesterFunc(PlausibleDate), TesterFunc(AllowedCollectionNames), TesterFunc(SubtitleRepetition), TesterFunc(NoCurrencyInTitle), TesterFunc(NoExcessivePunctuation), TesterFunc(HasPublisher), TesterFunc(FeasibleAuthor), TesterFunc(NoRepeatedSlash), TesterFunc(HasURL), }
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 FeasibleAuthor ¶ added in v0.1.2
func FeasibleAuthor(is finc.IntermediateSchema) error
FeasibleAuthor checks for a few suspicious authors patterns, refs. #4892, #4940.
func HasPublisher ¶ added in v0.1.1
func HasPublisher(is finc.IntermediateSchema) error
HasPublisher tests, whether a publisher is given.
func HasURL ¶ added in v0.1.8
func HasURL(is finc.IntermediateSchema) error
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 NoExcessivePunctuation ¶ added in v0.1.1
func NoExcessivePunctuation(is finc.IntermediateSchema) error
NoExcessivePuctuation should detect things like this title: CrossRef????????????? https://goo.gl/AD0V1o
func NoRepeatedSlash ¶ added in v0.1.4
func NoRepeatedSlash(is finc.IntermediateSchema) error
NoRepeatedSlash checks a DOI for repeated slashes, refs. #6312.
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 Issue ¶ added in v0.1.1
type Issue struct { Kind Kind Record finc.IntermediateSchema Message string }
Issue contains information about a quality issue in an intermediate schema record.
type Kind ¶
type Kind uint16
const ( KeyTooLong Kind = iota InvalidStartPage InvalidEndPage EndPageBeforeStartPage InvalidURL SuspiciousPageCount PublicationDateTooEarly PublicationDateTooLate InvalidCollection RepeatedSubtitle CurrencyInTitle ExcessivePunctuation NoPublisher ShortAuthorName EtAlAuthorName NAInAuthorName WhitespaceAuthor RepeatedSlash NoURL )
type Tester ¶ added in v0.1.1
type Tester interface {
TestRecord(finc.IntermediateSchema) error
}
Tester is a intermediate record checker.
type TesterFunc ¶ added in v0.1.1
type TesterFunc func(finc.IntermediateSchema) error
TesterFunc makes a function satisfy an interface.
func (TesterFunc) TestRecord ¶ added in v0.1.1
func (f TesterFunc) TestRecord(is finc.IntermediateSchema) error
TestRecord delegates test to the given func.