Skip to content

Commit

Permalink
Language: add 'synth.py'. (#6080)
Browse files Browse the repository at this point in the history
Closes #6072.
  • Loading branch information
tseaver authored Sep 25, 2018
1 parent 329932e commit 4350b49
Show file tree
Hide file tree
Showing 11 changed files with 1,165 additions and 970 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Copyright 2017, Google LLC All rights reserved.
# -*- coding: utf-8 -*-
#
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
Expand All @@ -13,8 +15,10 @@
# limitations under the License.
"""Wrappers for protocol buffer enum types."""

import enum


class EncodingType(object):
class EncodingType(enum.IntEnum):
"""
Represents the text encoding that the caller uses to process the output.
Providing an ``EncodingType`` is recommended because the API provides the
Expand Down Expand Up @@ -42,7 +46,7 @@ class EncodingType(object):


class Document(object):
class Type(object):
class Type(enum.IntEnum):
"""
The document types enum.
Expand All @@ -57,7 +61,7 @@ class Type(object):


class Entity(object):
class Type(object):
class Type(enum.IntEnum):
"""
The type of the entity.
Expand All @@ -82,7 +86,7 @@ class Type(object):


class PartOfSpeech(object):
class Tag(object):
class Tag(enum.IntEnum):
"""
The part of speech tags enum.
Expand Down Expand Up @@ -117,7 +121,7 @@ class Tag(object):
X = 12
AFFIX = 13

class Aspect(object):
class Aspect(enum.IntEnum):
"""
The characteristic of a verb that expresses time flow during an event.
Expand All @@ -132,7 +136,7 @@ class Aspect(object):
IMPERFECTIVE = 2
PROGRESSIVE = 3

class Case(object):
class Case(enum.IntEnum):
"""
The grammatical function performed by a noun or pronoun in a phrase,
clause, or sentence. In some languages, other parts of speech, such as
Expand Down Expand Up @@ -171,7 +175,7 @@ class Case(object):
RELATIVE_CASE = 13
VOCATIVE = 14

class Form(object):
class Form(enum.IntEnum):
"""
Depending on the language, Form can be categorizing different forms of
verbs, adjectives, adverbs, etc. For example, categorizing inflected
Expand Down Expand Up @@ -205,7 +209,7 @@ class Form(object):
ORDER = 10
SPECIFIC = 11

class Gender(object):
class Gender(enum.IntEnum):
"""
Gender classes of nouns reflected in the behaviour of associated words.
Expand All @@ -220,7 +224,7 @@ class Gender(object):
MASCULINE = 2
NEUTER = 3

class Mood(object):
class Mood(enum.IntEnum):
"""
The grammatical feature of verbs, used for showing modality and attitude.
Expand All @@ -241,7 +245,7 @@ class Mood(object):
JUSSIVE = 5
SUBJUNCTIVE = 6

class Number(object):
class Number(enum.IntEnum):
"""
Count distinctions.
Expand All @@ -256,7 +260,7 @@ class Number(object):
PLURAL = 2
DUAL = 3

class Person(object):
class Person(enum.IntEnum):
"""
The distinction between the speaker, second person, third person, etc.
Expand All @@ -273,7 +277,7 @@ class Person(object):
THIRD = 3
REFLEXIVE_PERSON = 4

class Proper(object):
class Proper(enum.IntEnum):
"""
This category shows if the token is part of a proper name.
Expand All @@ -286,7 +290,7 @@ class Proper(object):
PROPER = 1
NOT_PROPER = 2

class Reciprocity(object):
class Reciprocity(enum.IntEnum):
"""
Reciprocal features of a pronoun.
Expand All @@ -300,7 +304,7 @@ class Reciprocity(object):
RECIPROCAL = 1
NON_RECIPROCAL = 2

class Tense(object):
class Tense(enum.IntEnum):
"""
Time reference.
Expand All @@ -321,7 +325,7 @@ class Tense(object):
IMPERFECT = 5
PLUPERFECT = 6

class Voice(object):
class Voice(enum.IntEnum):
"""
The relationship between the action that a verb expresses and the
participants identified by its arguments.
Expand All @@ -339,7 +343,7 @@ class Voice(object):


class DependencyEdge(object):
class Label(object):
class Label(enum.IntEnum):
"""
The parse label enum for the token.
Expand Down Expand Up @@ -514,7 +518,7 @@ class Label(object):


class EntityMention(object):
class Type(object):
class Type(enum.IntEnum):
"""
The supported types of mentions.
Expand Down
Loading

0 comments on commit 4350b49

Please sign in to comment.