stanfordcorenlp

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(ctx context.Context, url string) *client

NewClient is a factory method to create a client for Stanford CoreNLP server.

Types

type AnnotatorType added in v1.0.1

type AnnotatorType int
const (
	AnnotatorTokenize AnnotatorType = 1 << iota
	AnnotatorCleanxml
	AnnotatorSsplit
	AnnotatorDocdate
	AnnotatorPos
	AnnotatorLemma
	AnnotatorNer
	AnnotatorRegexner
	AnnotatorSentiment
	AnnotatorParse
	AnnotatorDepparse
	AnnotatorDcoref
	AnnotatorRelation
	AnnotatorNatlog
	AnnotatorEntitylink
	AnnotatorKbp
	AnnotatorQuote
)

func (AnnotatorType) MarshalJSON added in v1.0.1

func (a AnnotatorType) MarshalJSON() ([]byte, error)

func (AnnotatorType) String added in v1.0.1

func (a AnnotatorType) String() string

type Client

type Client interface {
	Do(ctx context.Context, text string, annotators AnnotatorType) ([]byte, error)
}

type DependencyNode

type DependencyNode struct {
	Dep            string `json:"dep"`
	Governor       int    `json:"governor"`
	GovernorGloss  string `json:"governorGloss"`
	Dependent      int    `json:"dependent"`
	DependentGloss string `json:"dependentGloss"`
}

type Document

type Document struct {
	Sentences []*Sentence `json:"sentences"`
}

func UnmarshalDocument added in v1.0.1

func UnmarshalDocument(data []byte) (*Document, error)

func (*Document) String

func (d *Document) String() string

type Sentence

type Sentence struct {
	Index                        int               `json:"index"`
	Tokens                       []*Token          `json:"tokens"`
	Parse                        string            `json:"parse,omitempty"`
	BasicDependencies            []*DependencyNode `json:"basicDependencies,omitempty"`
	EnhancedDependencies         []*DependencyNode `json:"enhancedDependencies,omitempty"`
	EnhancedPlusPlusDependencies []*DependencyNode `json:"enhancedPlusPlusDependencies,omitempty"`
}

func UnmarshalSentence added in v1.0.1

func UnmarshalSentence(data []byte) (*Sentence, error)

func (*Sentence) String

func (s *Sentence) String() string

type Token

type Token struct {
	Index                int    `json:"index"`
	Word                 string `json:"word"`
	OriginalText         string `json:"originalText,omitempty"`
	Lemma                string `json:"lemma,omitempty"`
	CharacterOffsetBegin int    `json:"characterOffsetBegin,omitempty"`
	CharacterOffsetEnd   int    `json:"characterOffsetEnd,omitempty"`
	Pos                  string `json:"pos,omitempty"`
	Before               string `json:"before,omitempty"`
	After                string `json:"after,omitempty"`
}

func (*Token) String

func (t *Token) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL