Documentation
¶
Index ¶
- type Analysis
- type Article
- func (a *Article) AddSimpleId() *Article
- func (a *Article) Clone(options ...ArticleOption) *Article
- func (a *Article) GetPermalink() *string
- func (a *Article) ID(source string) (string, bool)
- func (a *Article) KeepReferences(ids ...string) *Article
- func (a *Article) Key() *string
- func (a *Article) Merge(other *Article) *Article
- func (a *Article) PurgeReferences(ids ...string) *Article
- func (a *Article) SetSimpleLabel() *Article
- func (a *Article) SimpleId() *string
- func (a *Article) SimpleLabel() *string
- type ArticleOption
- type Articles
- type Category
- type Collection
- func (c *Collection) All() iter.Seq[*Article]
- func (c *Collection) CitationGraph() (gograph.Graph[string], error)
- func (c *Collection) Clean() (*Collection, error)
- func (c *Collection) Keep(labels ...string) (*Collection, error)
- func (c *Collection) Len() int
- func (c *Collection) Main() iter.Seq[*Article]
- func (c *Collection) MarshalJSON() ([]byte, error)
- func (c *Collection) Merge(other *Collection) (*Collection, error)
- func (c *Collection) Purge(ids ...string) (*Collection, error)
- type Link
- type Node
- type NodeMetadata
- type References
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Article ¶
type Article struct {
Label string `json:"label"`
IDs *collections.Set[string] `json:"ids,omitempty"`
Authors []string `json:"authors,omitempty"`
Year *int `json:"year,omitempty"`
Title *string `json:"title,omitempty"`
Journal *string `json:"journal,omitempty"`
Volume *string `json:"volume,omitempty"`
Issue *string `json:"issue,omitempty"`
Page *string `json:"page,omitempty"`
DOI *string `json:"doi,omitempty"`
Permalink *string `json:"permalink,omitempty"`
TimesCited *int `json:"times_cited,omitempty"`
Keywords *collections.Set[string] `json:"keywords,omitempty"`
Abstract *string `json:"abstract,omitempty"`
References References `json:"references,omitempty"`
Rich bool `json:"rich"`
}
func (*Article) AddSimpleId ¶
AddSimpleId adds a simple ID to the Article's IDs set.
func (*Article) Clone ¶
func (a *Article) Clone(options ...ArticleOption) *Article
func (*Article) GetPermalink ¶
Permalink returns the permalink of the Article if it exists.
func (*Article) KeepReferences ¶
func (*Article) Merge ¶
Merge creates a new Article by merging the fields of the current Article with another Article.
func (*Article) PurgeReferences ¶
func (*Article) SetSimpleLabel ¶
SetSimpleLabel sets a simplified label for the Article.
func (*Article) SimpleLabel ¶
SimpleLabel returns a simplified label for the Article.
type ArticleOption ¶
type ArticleOption func(*Article)
func WithReferences ¶
func WithReferences(references []*Article) ArticleOption
type Articles ¶
type Articles []*Article
func (*Articles) Deduplicate ¶
Deduplicate returns a slice of unique articles, preserving the order of the first occurrence of each article.
type Collection ¶
type Collection struct {
// contains filtered or unexported fields
}
Collection represents a collection of articles with methods to manage them.
func NewCollection ¶
func NewCollection(a Articles) (*Collection, error)
NewCollection creates a new Collection instance with deduplicated articles.
func (*Collection) All ¶
func (c *Collection) All() iter.Seq[*Article]
All returns an iterator over all articles in the collection, including their references.
func (*Collection) CitationGraph ¶
func (c *Collection) CitationGraph() (gograph.Graph[string], error)
CitationGraph returns a directed graph representing the citation relationships between articles in the collection.
func (*Collection) Clean ¶
func (c *Collection) Clean() (*Collection, error)
Clean returns a clean version of the largest connected component of the collection.
func (*Collection) Keep ¶
func (c *Collection) Keep(labels ...string) (*Collection, error)
func (*Collection) Len ¶
func (c *Collection) Len() int
Len returns the number of articles in the collection.
func (*Collection) Main ¶
func (c *Collection) Main() iter.Seq[*Article]
Main returns an iterator over the main articles in the collection, excluding duplicates.
func (*Collection) MarshalJSON ¶
func (c *Collection) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface for Collection.
func (*Collection) Merge ¶
func (c *Collection) Merge(other *Collection) (*Collection, error)
Merge merges another collection into the current collection.
func (*Collection) Purge ¶
func (c *Collection) Purge(ids ...string) (*Collection, error)
Purge removes articles from the collection by their IDs.
type Node ¶
type Node struct {
ID string `json:"id"`
Category Category `json:"category"`
Rootness float64 `json:"rootness"`
Trunkness float64 `json:"trunkness"`
Leafness float64 `json:"leafness"`
Article *Article `json:"article"`
}
func (*Node) Metadata ¶
func (n *Node) Metadata() *NodeMetadata
type NodeMetadata ¶
type NodeMetadata struct {
ID string `yaml:"id"`
Label string `yaml:"label"`
Category string `yaml:"category"`
Rootness float64 `yaml:"rootness"`
Trunkness float64 `yaml:"trunkness"`
Leafness float64 `yaml:"leafness"`
Rich bool `yaml:"rich"`
Title *utils.FoldedString `yaml:"title,omitempty"`
Year *int `yaml:"year,omitempty"`
Journal *utils.FoldedString `yaml:"journal,omitempty"`
Volume *string `yaml:"volume,omitempty"`
Issue *string `yaml:"issue,omitempty"`
Page *string `yaml:"page,omitempty"`
DOI *string `yaml:"doi,omitempty"`
Permalink *string `yaml:"permalink,omitempty"`
TimesCited *int `yaml:"times_cited,omitempty"`
Authors []string `yaml:"authors,omitempty"`
IDs []string `yaml:"ids,omitempty"`
}
type References ¶
type References []*Article
References prevents circular references by using a slice of Article pointers.
func (References) MarshalJSON ¶
func (r References) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface.