Documentation ¶
Overview ¶
Package api is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterParsitApiSpecServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterParsitApiSpecServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ParsitApiSpecServiceClient) error
- func RegisterParsitApiSpecServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterParsitApiSpecServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ParsitApiSpecServiceServer) error
- func RegisterParsitApiSpecServiceServer(s grpc.ServiceRegistrar, srv ParsitApiSpecServiceServer)
- type Coreference
- func (*Coreference) Descriptor() ([]byte, []int)deprecated
- func (x *Coreference) GetScore() float64
- func (x *Coreference) GetSentenceId() int32
- func (x *Coreference) GetTokenId() int32
- func (*Coreference) ProtoMessage()
- func (x *Coreference) ProtoReflect() protoreflect.Message
- func (x *Coreference) Reset()
- func (x *Coreference) String() string
- type Error
- type Morphology
- func (*Morphology) Descriptor() ([]byte, []int)deprecated
- func (x *Morphology) GetCase() string
- func (x *Morphology) GetCtxGender() string
- func (x *Morphology) GetCtxMood() string
- func (x *Morphology) GetCtxNumber() string
- func (x *Morphology) GetCtxPerson() string
- func (x *Morphology) GetCtxVoice() string
- func (x *Morphology) GetDegree() string
- func (x *Morphology) GetGender() string
- func (x *Morphology) GetLemma() string
- func (x *Morphology) GetMood() string
- func (x *Morphology) GetNumber() string
- func (x *Morphology) GetPerson() string
- func (x *Morphology) GetPos() string
- func (x *Morphology) GetTense() string
- func (*Morphology) ProtoMessage()
- func (x *Morphology) ProtoReflect() protoreflect.Message
- func (x *Morphology) Reset()
- func (x *Morphology) String() string
- type ParsitApiSpecServiceClient
- type ParsitApiSpecServiceServer
- type PostForParsingRequest
- func (*PostForParsingRequest) Descriptor() ([]byte, []int)deprecated
- func (x *PostForParsingRequest) GetRequest() *Request
- func (*PostForParsingRequest) ProtoMessage()
- func (x *PostForParsingRequest) ProtoReflect() protoreflect.Message
- func (x *PostForParsingRequest) Reset()
- func (x *PostForParsingRequest) String() string
- type Request
- type Response
- type Sentence
- func (*Sentence) Descriptor() ([]byte, []int)deprecated
- func (x *Sentence) GetId() int32
- func (x *Sentence) GetScore() float64
- func (x *Sentence) GetTokens() []*Token
- func (*Sentence) ProtoMessage()
- func (x *Sentence) ProtoReflect() protoreflect.Message
- func (x *Sentence) Reset()
- func (x *Sentence) String() string
- type Token
- func (*Token) Descriptor() ([]byte, []int)deprecated
- func (x *Token) GetCoref() []*Coreference
- func (x *Token) GetDeprel() string
- func (x *Token) GetEnd() int32
- func (x *Token) GetForm() string
- func (x *Token) GetHead() int32
- func (x *Token) GetId() int32
- func (x *Token) GetMorpho() []*Morphology
- func (x *Token) GetPos() string
- func (x *Token) GetPosition() string
- func (x *Token) GetScore() float64
- func (x *Token) GetSemantic() []string
- func (x *Token) GetStart() int32
- func (x *Token) GetType() string
- func (*Token) ProtoMessage()
- func (x *Token) ProtoReflect() protoreflect.Message
- func (x *Token) Reset()
- func (x *Token) String() string
- type UnimplementedParsitApiSpecServiceServer
- type UnsafeParsitApiSpecServiceServer
Constants ¶
This section is empty.
Variables ¶
var File_service_proto protoreflect.FileDescriptor
Functions ¶
func RegisterParsitApiSpecServiceHandler ¶
func RegisterParsitApiSpecServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterParsitApiSpecServiceHandler registers the http handlers for service ParsitApiSpecService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterParsitApiSpecServiceHandlerClient ¶
func RegisterParsitApiSpecServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ParsitApiSpecServiceClient) error
RegisterParsitApiSpecServiceHandlerClient registers the http handlers for service ParsitApiSpecService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ParsitApiSpecServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ParsitApiSpecServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ParsitApiSpecServiceClient" to call the correct interceptors.
func RegisterParsitApiSpecServiceHandlerFromEndpoint ¶
func RegisterParsitApiSpecServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterParsitApiSpecServiceHandlerFromEndpoint is same as RegisterParsitApiSpecServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterParsitApiSpecServiceHandlerServer ¶
func RegisterParsitApiSpecServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ParsitApiSpecServiceServer) error
RegisterParsitApiSpecServiceHandlerServer registers the http handlers for service ParsitApiSpecService to "mux". UnaryRPC :call ParsitApiSpecServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterParsitApiSpecServiceHandlerFromEndpoint instead.
func RegisterParsitApiSpecServiceServer ¶
func RegisterParsitApiSpecServiceServer(s grpc.ServiceRegistrar, srv ParsitApiSpecServiceServer)
Types ¶
type Coreference ¶
type Coreference struct { // Confidence for the coreference Score float64 `protobuf:"fixed64,1,opt,name=score,proto3" json:"score,omitempty"` // The target sentence ID SentenceId int32 `protobuf:"varint,2,opt,name=sentenceId,proto3" json:"sentenceId,omitempty"` // The target token ID TokenId int32 `protobuf:"varint,3,opt,name=tokenId,proto3" json:"tokenId,omitempty"` // contains filtered or unexported fields }
func (*Coreference) Descriptor
deprecated
func (*Coreference) Descriptor() ([]byte, []int)
Deprecated: Use Coreference.ProtoReflect.Descriptor instead.
func (*Coreference) GetScore ¶
func (x *Coreference) GetScore() float64
func (*Coreference) GetSentenceId ¶
func (x *Coreference) GetSentenceId() int32
func (*Coreference) GetTokenId ¶
func (x *Coreference) GetTokenId() int32
func (*Coreference) ProtoMessage ¶
func (*Coreference) ProtoMessage()
func (*Coreference) ProtoReflect ¶
func (x *Coreference) ProtoReflect() protoreflect.Message
func (*Coreference) Reset ¶
func (x *Coreference) Reset()
func (*Coreference) String ¶
func (x *Coreference) String() string
type Error ¶
type Error struct { Message string `protobuf:"bytes,1,opt,name=Message,proto3" json:"Message,omitempty"` // contains filtered or unexported fields }
func (*Error) Descriptor
deprecated
func (*Error) GetMessage ¶
func (*Error) ProtoMessage ¶
func (*Error) ProtoMessage()
func (*Error) ProtoReflect ¶
func (x *Error) ProtoReflect() protoreflect.Message
type Morphology ¶
type Morphology struct { // Grammatical case Case string `protobuf:"bytes,1,opt,name=case,proto3" json:"case,omitempty"` // Grammatical gender in the sentence context CtxGender string `protobuf:"bytes,2,opt,name=ctx_gender,json=ctxGender,proto3" json:"ctx_gender,omitempty"` // Verbal mood in the sentence context CtxMood string `protobuf:"bytes,3,opt,name=ctx_mood,json=ctxMood,proto3" json:"ctx_mood,omitempty"` // Number in the sentence context CtxNumber string `protobuf:"bytes,4,opt,name=ctx_number,json=ctxNumber,proto3" json:"ctx_number,omitempty"` // Person in the sentence context CtxPerson string `protobuf:"bytes,5,opt,name=ctx_person,json=ctxPerson,proto3" json:"ctx_person,omitempty"` // Verbal voice in the sentence context CtxVoice string `protobuf:"bytes,6,opt,name=ctx_voice,json=ctxVoice,proto3" json:"ctx_voice,omitempty"` // Degree Degree string `protobuf:"bytes,7,opt,name=degree,proto3" json:"degree,omitempty"` // Grammatical gender Gender string `protobuf:"bytes,8,opt,name=gender,proto3" json:"gender,omitempty"` // The lemma Lemma string `protobuf:"bytes,9,opt,name=lemma,proto3" json:"lemma,omitempty"` // Verbal mood Mood string `protobuf:"bytes,10,opt,name=mood,proto3" json:"mood,omitempty"` // Number Number string `protobuf:"bytes,11,opt,name=number,proto3" json:"number,omitempty"` // Person Person string `protobuf:"bytes,12,opt,name=person,proto3" json:"person,omitempty"` // Part-of-speech tag Pos string `protobuf:"bytes,13,opt,name=pos,proto3" json:"pos,omitempty"` // Verbal tense Tense string `protobuf:"bytes,14,opt,name=tense,proto3" json:"tense,omitempty"` // contains filtered or unexported fields }
func (*Morphology) Descriptor
deprecated
func (*Morphology) Descriptor() ([]byte, []int)
Deprecated: Use Morphology.ProtoReflect.Descriptor instead.
func (*Morphology) GetCase ¶
func (x *Morphology) GetCase() string
func (*Morphology) GetCtxGender ¶
func (x *Morphology) GetCtxGender() string
func (*Morphology) GetCtxMood ¶
func (x *Morphology) GetCtxMood() string
func (*Morphology) GetCtxNumber ¶
func (x *Morphology) GetCtxNumber() string
func (*Morphology) GetCtxPerson ¶
func (x *Morphology) GetCtxPerson() string
func (*Morphology) GetCtxVoice ¶
func (x *Morphology) GetCtxVoice() string
func (*Morphology) GetDegree ¶
func (x *Morphology) GetDegree() string
func (*Morphology) GetGender ¶
func (x *Morphology) GetGender() string
func (*Morphology) GetLemma ¶
func (x *Morphology) GetLemma() string
func (*Morphology) GetMood ¶
func (x *Morphology) GetMood() string
func (*Morphology) GetNumber ¶
func (x *Morphology) GetNumber() string
func (*Morphology) GetPerson ¶
func (x *Morphology) GetPerson() string
func (*Morphology) GetPos ¶
func (x *Morphology) GetPos() string
func (*Morphology) GetTense ¶
func (x *Morphology) GetTense() string
func (*Morphology) ProtoMessage ¶
func (*Morphology) ProtoMessage()
func (*Morphology) ProtoReflect ¶
func (x *Morphology) ProtoReflect() protoreflect.Message
func (*Morphology) Reset ¶
func (x *Morphology) Reset()
func (*Morphology) String ¶
func (x *Morphology) String() string
type ParsitApiSpecServiceClient ¶
type ParsitApiSpecServiceClient interface { // Receives a text in Italian and returns its morpho-syntactic structure PostForParsing(ctx context.Context, in *PostForParsingRequest, opts ...grpc.CallOption) (*Response, error) }
ParsitApiSpecServiceClient is the client API for ParsitApiSpecService 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 NewParsitApiSpecServiceClient ¶
func NewParsitApiSpecServiceClient(cc grpc.ClientConnInterface) ParsitApiSpecServiceClient
type ParsitApiSpecServiceServer ¶
type ParsitApiSpecServiceServer interface { // Receives a text in Italian and returns its morpho-syntactic structure PostForParsing(context.Context, *PostForParsingRequest) (*Response, error) // contains filtered or unexported methods }
ParsitApiSpecServiceServer is the server API for ParsitApiSpecService service. All implementations must embed UnimplementedParsitApiSpecServiceServer for forward compatibility
type PostForParsingRequest ¶
type PostForParsingRequest struct { // Request to the parsing service Request *Request `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"` // contains filtered or unexported fields }
func (*PostForParsingRequest) Descriptor
deprecated
func (*PostForParsingRequest) Descriptor() ([]byte, []int)
Deprecated: Use PostForParsingRequest.ProtoReflect.Descriptor instead.
func (*PostForParsingRequest) GetRequest ¶
func (x *PostForParsingRequest) GetRequest() *Request
func (*PostForParsingRequest) ProtoMessage ¶
func (*PostForParsingRequest) ProtoMessage()
func (*PostForParsingRequest) ProtoReflect ¶
func (x *PostForParsingRequest) ProtoReflect() protoreflect.Message
func (*PostForParsingRequest) Reset ¶
func (x *PostForParsingRequest) Reset()
func (*PostForParsingRequest) String ¶
func (x *PostForParsingRequest) String() string
type Request ¶
type Request struct { // The text to parse Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"` // contains filtered or unexported fields }
func (*Request) Descriptor
deprecated
func (*Request) ProtoMessage ¶
func (*Request) ProtoMessage()
func (*Request) ProtoReflect ¶
func (x *Request) ProtoReflect() protoreflect.Message
type Response ¶
type Response struct { // List of sentences Sentences []*Sentence `protobuf:"bytes,1,rep,name=sentences,proto3" json:"sentences,omitempty"` // contains filtered or unexported fields }
func (*Response) Descriptor
deprecated
func (*Response) GetSentences ¶
func (*Response) ProtoMessage ¶
func (*Response) ProtoMessage()
func (*Response) ProtoReflect ¶
func (x *Response) ProtoReflect() protoreflect.Message
type Sentence ¶
type Sentence struct { // The ID of the sentence Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // Confidence of overall sentence attachments Score float64 `protobuf:"fixed64,2,opt,name=score,proto3" json:"score,omitempty"` // List of tokens Tokens []*Token `protobuf:"bytes,3,rep,name=tokens,proto3" json:"tokens,omitempty"` // contains filtered or unexported fields }
func (*Sentence) Descriptor
deprecated
func (*Sentence) ProtoMessage ¶
func (*Sentence) ProtoMessage()
func (*Sentence) ProtoReflect ¶
func (x *Sentence) ProtoReflect() protoreflect.Message
type Token ¶
type Token struct { // List of tokens Coref []*Coreference `protobuf:"bytes,1,rep,name=coref,proto3" json:"coref,omitempty"` // Dependency relation Deprel string `protobuf:"bytes,2,opt,name=deprel,proto3" json:"deprel,omitempty"` // Index of the last character of the token in the original text End int32 `protobuf:"varint,3,opt,name=end,proto3" json:"end,omitempty"` // Form of the token as in the original text Form string `protobuf:"bytes,4,opt,name=form,proto3" json:"form,omitempty"` // Syntactic head (-1 for the ROOT) Head int32 `protobuf:"varint,5,opt,name=head,proto3" json:"head,omitempty"` // ID of the token Id int32 `protobuf:"varint,6,opt,name=id,proto3" json:"id,omitempty"` // List of possible morphological interpretations Morpho []*Morphology `protobuf:"bytes,7,rep,name=morpho,proto3" json:"morpho,omitempty"` // Coarse-grained part-of-speech tag Pos string `protobuf:"bytes,8,opt,name=pos,proto3" json:"pos,omitempty"` // Index of the token (not the ID) Position string `protobuf:"bytes,9,opt,name=position,proto3" json:"position,omitempty"` // Confidence for the syntactic attachment Score float64 `protobuf:"fixed64,10,opt,name=score,proto3" json:"score,omitempty"` // List of semantic labels Semantic []string `protobuf:"bytes,11,rep,name=semantic,proto3" json:"semantic,omitempty"` // Index of the first character of the token in the original text Start int32 `protobuf:"varint,12,opt,name=start,proto3" json:"start,omitempty"` // Token type (one of WORD, WORD_TRACE, TRACE) Type string `protobuf:"bytes,13,opt,name=type,proto3" json:"type,omitempty"` // contains filtered or unexported fields }
func (*Token) Descriptor
deprecated
func (*Token) GetCoref ¶
func (x *Token) GetCoref() []*Coreference
func (*Token) GetMorpho ¶
func (x *Token) GetMorpho() []*Morphology
func (*Token) GetPosition ¶
func (*Token) GetSemantic ¶
func (*Token) ProtoMessage ¶
func (*Token) ProtoMessage()
func (*Token) ProtoReflect ¶
func (x *Token) ProtoReflect() protoreflect.Message
type UnimplementedParsitApiSpecServiceServer ¶
type UnimplementedParsitApiSpecServiceServer struct { }
UnimplementedParsitApiSpecServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedParsitApiSpecServiceServer) PostForParsing ¶
func (UnimplementedParsitApiSpecServiceServer) PostForParsing(context.Context, *PostForParsingRequest) (*Response, error)
type UnsafeParsitApiSpecServiceServer ¶
type UnsafeParsitApiSpecServiceServer interface {
// contains filtered or unexported methods
}
UnsafeParsitApiSpecServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ParsitApiSpecServiceServer will result in compilation errors.