academia
Version:
Tools for analyzing academic text
82 lines (80 loc) • 2.22 kB
TypeScript
/**
Textual: Brown (2015)
Parenthetical: (Brown 2015)
Alternate: Brown 2015
*/
export declare enum CiteStyle {
Textual = 0,
Parenthetical = 1,
Alternate = 2,
}
export interface Origin {
/** the location of the string within the paper */
pointer: string;
/** the offset within the string located by `pointer` */
offset?: number;
/** the length of the citation within the string located by `pointer` */
length?: number;
}
/**
Cite: in-paper reference to an article listed in the Bibliography.
*/
export interface Cite {
/** the style of citation */
style: CiteStyle;
/** the content of the cite */
text: string;
/** the origin of the cite */
origin: Origin;
/** pointers to the reference(s) it matches */
references: string[];
}
export interface AuthorYearCite extends Cite {
/** usually only last names, one of which may be 'al.' (from 'et al.') */
authors: Name[];
/** not necessarily a number, if there is a letter suffix */
year: string;
}
export interface Name {
first?: string;
middle?: string;
last: string;
}
/**
Reference: an article as listed in a Bibliography. This means that the authors
may be truncated, the year may include a suffix (for disambiguation), and other
fields may include abbreviations.
*/
export interface Reference {
/** not always full names */
authors: Name[];
year: string;
title: string;
/** journal / specific conference / website; may be abbreviated */
venue?: string;
/** company name / conference */
publisher?: string;
pages?: [number, number];
/** the original text */
source?: string;
}
export interface Section {
/** 'title' could also be called 'header' */
title: string;
paragraphs: string[];
}
/**
Paper: a representation of any kind of academic paper / conference
presentation / manuscript. This preserves no formatting beyond sections /
paragraph distinctions.
`sections` is a flat list; abstracts / subsections / references all count at
the same level.
*/
export interface Paper {
title?: string;
authors?: Name[];
year?: number;
sections: Section[];
references?: Reference[];
cites?: Cite[];
}