Documentation ¶
Overview ¶
Package termservice provides a generic definition of a simple gRPC service for extracting or generating terms from a text.
Index ¶
- Variables
- func RegisterTermServiceServer(s grpc.ServiceRegistrar, srv TermServiceServer)
- type MakeTermsReply
- type MakeTermsRequest
- type Term
- func (*Term) Descriptor() ([]byte, []int)deprecated
- func (x *Term) GetHighlightable() bool
- func (x *Term) GetPositionInText() *UInt32Range
- func (x *Term) GetValue() string
- func (*Term) ProtoMessage()
- func (x *Term) ProtoReflect() protoreflect.Message
- func (x *Term) Reset()
- func (x *Term) String() string
- type TermServiceClient
- type TermServiceServer
- type UInt32Range
- type UnimplementedTermServiceServer
- type UnsafeTermServiceServer
Constants ¶
This section is empty.
Variables ¶
var File_termservice_proto protoreflect.FileDescriptor
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) GetHighlightable ¶
func (*Term) GetPositionInText ¶
func (x *Term) GetPositionInText() *UInt32Range
func (*Term) ProtoMessage ¶
func (*Term) ProtoMessage()
func (*Term) ProtoReflect ¶
func (x *Term) ProtoReflect() protoreflect.Message
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.
func NewTermServiceClient ¶
func NewTermServiceClient(cc grpc.ClientConnInterface) TermServiceClient
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 ¶
func (UnimplementedTermServiceServer) MakeTerms(context.Context, *MakeTermsRequest) (*MakeTermsReply, error)
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.