article

package
v0.0.0-...-54b38c5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Article

type Article struct {
	ID        string
	Title     string
	Addr      url.URL
	Author    string
	Created   time.Time
	Updated   time.Time
	Published time.Time
	Body      string
	Summary   string
	Keywords  []string
	NER       NER
}

Article represents a news article. The fields title, addr, author and published form the original news article. The other fields are used for searching and book keeping.

func (Article) Equal

func (a Article) Equal(b Article) bool

Equal checks if this Article a is equal to the given Article b. Only fields from the original article are condsidered. Original properties are title, addr, author, date of publication and body. Fields are not been validated. All other fields of the article are not been checked.

type DB

type DB interface {
	Add(ctx context.Context, ar Article) (string, error)
	Get(ctx context.Context, id string) (Article, error)
}

type NER

type NER struct {
	// Pers is a list of persons found in the article.
	Pers []string
	// Locs is a list of locations found in the article.
	Locs []string
	// Orgs is a list of Organisations found in the article.
	Orgs []string
}

NER holds lists of the different entity types found in an article.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳