termservice

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package termservice provides a generic definition of a simple gRPC service for extracting or generating terms from a text.

Index

Constants

This section is empty.

Variables

View Source
var File_termservice_proto protoreflect.FileDescriptor
View Source
var TermService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "termservice.TermService",
	HandlerType: (*TermServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "MakeTerms",
			Handler:    _TermService_MakeTerms_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "termservice.proto",
}

TermService_ServiceDesc is the grpc.ServiceDesc for TermService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterTermServiceServer

func RegisterTermServiceServer(s grpc.ServiceRegistrar, srv TermServiceServer)

Types

type MakeTermsReply

type MakeTermsReply struct {

	// List of terms.
	Terms []*Term `protobuf:"bytes,1,rep,name=terms,proto3" json:"terms,omitempty"`
	// contains filtered or unexported fields
}

MakeTermsReply is the response providing terms extracted or generated from a text.

func (*MakeTermsReply) Descriptor deprecated

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

Deprecated: Use MakeTermsReply.ProtoReflect.Descriptor instead.

func (*MakeTermsReply) GetTerms

func (x *MakeTermsReply) GetTerms() []*Term

func (*MakeTermsReply) ProtoMessage

func (*MakeTermsReply) ProtoMessage()

func (*MakeTermsReply) ProtoReflect

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

func (*MakeTermsReply) Reset

func (x *MakeTermsReply) Reset()

func (*MakeTermsReply) String

func (x *MakeTermsReply) String() string

type MakeTermsRequest

type MakeTermsRequest struct {

	// The input text.
	Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"`
	// contains filtered or unexported fields
}

MakeTermsRequest is the request for extracting or generating terms from a text.

func (*MakeTermsRequest) Descriptor deprecated

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

Deprecated: Use MakeTermsRequest.ProtoReflect.Descriptor instead.

func (*MakeTermsRequest) GetText

func (x *MakeTermsRequest) GetText() string

func (*MakeTermsRequest) ProtoMessage

func (*MakeTermsRequest) ProtoMessage()

func (*MakeTermsRequest) ProtoReflect

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

func (*MakeTermsRequest) Reset

func (x *MakeTermsRequest) Reset()

func (*MakeTermsRequest) String

func (x *MakeTermsRequest) String() string

type Term

type Term struct {

	// The textual value of the term, that is a text token
	// such as a lemma, a single or compound word, etc.
	Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
	// The Term can be optionally associated to a portion of the original
	// text, specifying the first and last positions (lower and upper bounds,
	// inclusive) of the matching unicode code points (runes).
	PositionInText *UInt32Range `protobuf:"bytes,2,opt,name=position_in_text,json=positionInText,proto3,oneof" json:"position_in_text,omitempty"`
	// Indicates whether this Term can be used as a candidate for
	// search results highlighting.
	Highlightable bool `protobuf:"varint,3,opt,name=highlightable,proto3" json:"highlightable,omitempty"`
	// contains filtered or unexported fields
}

Term is a single term extracted or generated from a text.

func (*Term) Descriptor deprecated

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

Deprecated: Use Term.ProtoReflect.Descriptor instead.

func (*Term) GetHighlightable

func (x *Term) GetHighlightable() bool

func (*Term) GetPositionInText

func (x *Term) GetPositionInText() *UInt32Range

func (*Term) GetValue

func (x *Term) GetValue() string

func (*Term) ProtoMessage

func (*Term) ProtoMessage()

func (*Term) ProtoReflect

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

func (*Term) Reset

func (x *Term) Reset()

func (*Term) String

func (x *Term) String() string

type TermServiceClient

type TermServiceClient interface {
	// MakeTerms extracts or generates terms from the given text.
	MakeTerms(ctx context.Context, in *MakeTermsRequest, opts ...grpc.CallOption) (*MakeTermsReply, error)
}

TermServiceClient is the client API for TermService 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.

type TermServiceServer

type TermServiceServer interface {
	// MakeTerms extracts or generates terms from the given text.
	MakeTerms(context.Context, *MakeTermsRequest) (*MakeTermsReply, error)
	// contains filtered or unexported methods
}

TermServiceServer is the server API for TermService service. All implementations must embed UnimplementedTermServiceServer for forward compatibility

type UInt32Range

type UInt32Range struct {

	// The lower bound.
	Lower uint32 `protobuf:"varint,1,opt,name=lower,proto3" json:"lower,omitempty"`
	// The upper bound.
	Upper uint32 `protobuf:"varint,2,opt,name=upper,proto3" json:"upper,omitempty"`
	// contains filtered or unexported fields
}

UInt32Range is represents a range of uint32 values.

func (*UInt32Range) Descriptor deprecated

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

Deprecated: Use UInt32Range.ProtoReflect.Descriptor instead.

func (*UInt32Range) GetLower

func (x *UInt32Range) GetLower() uint32

func (*UInt32Range) GetUpper

func (x *UInt32Range) GetUpper() uint32

func (*UInt32Range) ProtoMessage

func (*UInt32Range) ProtoMessage()

func (*UInt32Range) ProtoReflect

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

func (*UInt32Range) Reset

func (x *UInt32Range) Reset()

func (*UInt32Range) String

func (x *UInt32Range) String() string

type UnimplementedTermServiceServer

type UnimplementedTermServiceServer struct {
}

UnimplementedTermServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedTermServiceServer) MakeTerms

type UnsafeTermServiceServer

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

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

Jump to

Keyboard shortcuts

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