parsing

package
v0.0.0-...-955e833 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2021 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_parsing_proto protoreflect.FileDescriptor

Functions

func AnalyzeWords

func AnalyzeWords(db repositories.Repository, in <-chan Info, out chan<- Analyzed) error

AnalyzeWords converts channel of Info to channel of Analyzed

func FindWords

func FindWords(r io.Reader, ch chan<- Info)

func RegisterParserServer

func RegisterParserServer(s grpc.ServiceRegistrar, srv ParserServer)

Types

type Analyzed

type Analyzed struct {
	Info
	Identified bool
	Entity     string
	ID         int64
}

Analyzed composed with Info

type Info

type Info struct {
	Word  string
	Pos   int
	Index int
}

func ChannelHelper

func ChannelHelper(ch <-chan Info, wg *sync.WaitGroup) []Info

type Parser

type Parser interface {
	FindWords() []string
}

type ParserClient

type ParserClient interface {
	Parse(ctx context.Context, in *ParsingRequest, opts ...grpc.CallOption) (*ParsingResponse, error)
	StreamParse(ctx context.Context, in *ParsingRequest, opts ...grpc.CallOption) (Parser_StreamParseClient, error)
}

ParserClient is the client API for Parser service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewParserClient

func NewParserClient(cc grpc.ClientConnInterface) ParserClient

type ParserServer

type ParserServer interface {
	Parse(context.Context, *ParsingRequest) (*ParsingResponse, error)
	StreamParse(*ParsingRequest, Parser_StreamParseServer) error
	// contains filtered or unexported methods
}

ParserServer is the server API for Parser service. All implementations must embed UnimplementedParserServer for forward compatibility

type Parser_StreamParseClient

type Parser_StreamParseClient interface {
	Recv() (*ParsingResult, error)
	grpc.ClientStream
}

type Parser_StreamParseServer

type Parser_StreamParseServer interface {
	Send(*ParsingResult) error
	grpc.ServerStream
}

type ParsingRequest

type ParsingRequest struct {
	Input string `protobuf:"bytes,1,opt,name=input,proto3" json:"input,omitempty"`
	// contains filtered or unexported fields
}

func (*ParsingRequest) Descriptor deprecated

func (*ParsingRequest) Descriptor() ([]byte, []int)

Deprecated: Use ParsingRequest.ProtoReflect.Descriptor instead.

func (*ParsingRequest) GetInput

func (x *ParsingRequest) GetInput() string

func (*ParsingRequest) ProtoMessage

func (*ParsingRequest) ProtoMessage()

func (*ParsingRequest) ProtoReflect

func (x *ParsingRequest) ProtoReflect() protoreflect.Message

func (*ParsingRequest) Reset

func (x *ParsingRequest) Reset()

func (*ParsingRequest) String

func (x *ParsingRequest) String() string

type ParsingResponse

type ParsingResponse struct {
	Results []*ParsingResult `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"`
	// contains filtered or unexported fields
}

func (*ParsingResponse) Descriptor deprecated

func (*ParsingResponse) Descriptor() ([]byte, []int)

Deprecated: Use ParsingResponse.ProtoReflect.Descriptor instead.

func (*ParsingResponse) GetResults

func (x *ParsingResponse) GetResults() []*ParsingResult

func (*ParsingResponse) ProtoMessage

func (*ParsingResponse) ProtoMessage()

func (*ParsingResponse) ProtoReflect

func (x *ParsingResponse) ProtoReflect() protoreflect.Message

func (*ParsingResponse) Reset

func (x *ParsingResponse) Reset()

func (*ParsingResponse) String

func (x *ParsingResponse) String() string

type ParsingResult

type ParsingResult struct {
	Word       string `protobuf:"bytes,1,opt,name=word,proto3" json:"word,omitempty"`
	Position   int32  `protobuf:"varint,2,opt,name=position,proto3" json:"position,omitempty"`
	Index      int32  `protobuf:"varint,3,opt,name=index,proto3" json:"index,omitempty"`
	Identified bool   `protobuf:"varint,4,opt,name=identified,proto3" json:"identified,omitempty"`
	Entity     string `protobuf:"bytes,5,opt,name=entity,proto3" json:"entity,omitempty"`
	Id         int64  `protobuf:"varint,6,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*ParsingResult) Descriptor deprecated

func (*ParsingResult) Descriptor() ([]byte, []int)

Deprecated: Use ParsingResult.ProtoReflect.Descriptor instead.

func (*ParsingResult) GetEntity

func (x *ParsingResult) GetEntity() string

func (*ParsingResult) GetId

func (x *ParsingResult) GetId() int64

func (*ParsingResult) GetIdentified

func (x *ParsingResult) GetIdentified() bool

func (*ParsingResult) GetIndex

func (x *ParsingResult) GetIndex() int32

func (*ParsingResult) GetPosition

func (x *ParsingResult) GetPosition() int32

func (*ParsingResult) GetWord

func (x *ParsingResult) GetWord() string

func (*ParsingResult) ProtoMessage

func (*ParsingResult) ProtoMessage()

func (*ParsingResult) ProtoReflect

func (x *ParsingResult) ProtoReflect() protoreflect.Message

func (*ParsingResult) Reset

func (x *ParsingResult) Reset()

func (*ParsingResult) String

func (x *ParsingResult) String() string

type StringParser

type StringParser string

func (StringParser) FindWords

func (stringParser StringParser) FindWords() []string

type UnimplementedParserServer

type UnimplementedParserServer struct {
}

UnimplementedParserServer must be embedded to have forward compatible implementations.

func (UnimplementedParserServer) Parse

func (UnimplementedParserServer) StreamParse

type UnsafeParserServer

type UnsafeParserServer interface {
	// contains filtered or unexported methods
}

UnsafeParserServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ParserServer will result in compilation errors.

Jump to

Keyboard shortcuts

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