_SquashedParseTreeNode.py
Go to the documentation of this file.
00001 """autogenerated by genpy from stanford_parser_msgs/SquashedParseTreeNode.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006 
00007 
00008 class SquashedParseTreeNode(genpy.Message):
00009   _md5sum = "8e3f507a30ff03f4eed132c8e51d902b"
00010   _type = "stanford_parser_msgs/SquashedParseTreeNode"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """# tag is a part-of-speech tag from the list of constants below.
00013 int32 tag
00014 # parent_id is the location of the node pointing to this one in the tree, or -1 if root.
00015 int32 parent_id
00016 # score is a measure of confidence
00017 float64 score
00018 # word is the location of the word in the words array, or -1 if none.
00019 int32 word_index
00020 
00021 # Constants below, using descriptions from http://bulba.sdsu.edu/jeanette/thesis/PennTags.html
00022 # To make code-safe, we use the following substitutions:
00023 #   '-' -> '_'
00024 #   '$' -> '_S'
00025 int32 ROOT=-100
00026 int32 ADJP=-101
00027 int32 _ADV=-102
00028 int32 ADVP=-103
00029 int32 _BNF=-104
00030 int32 CC=-105
00031 int32 CD=-106
00032 int32 _CLF=-107
00033 int32 _CLR=-108
00034 int32 CONJP=-109
00035 int32 _DIR=-110
00036 int32 DT=-111
00037 int32 _DTV=-112
00038 int32 EX=-113
00039 int32 _EXT=-114
00040 int32 FRAG=-115
00041 int32 FW=-116
00042 int32 _HLN=-117
00043 int32 IN=-118
00044 int32 INTJ=-119
00045 int32 JJ=-120
00046 int32 JJR=-121
00047 int32 JJS=-122
00048 int32 _LGS=-123
00049 int32 _LOC=-124
00050 int32 LS=-125
00051 int32 LST=-126
00052 int32 MD=-127
00053 int32 _MNR=-128
00054 int32 NAC=-129
00055 int32 NN=-130
00056 int32 NNS=-131
00057 int32 NNP=-132
00058 int32 NNPS=-133
00059 int32 _NOM=-134
00060 int32 NP=-135
00061 int32 NX=-136
00062 int32 PDT=-137
00063 int32 POS=-138
00064 int32 PP=-139
00065 int32 _PRD=-140
00066 int32 PRN=-141
00067 int32 PRP=-142
00068 int32 _PRP=-143
00069 int32 PRP_S=-144
00070 int32 PRT=-145
00071 int32 _PUT=-146
00072 int32 QP=-147
00073 int32 RB=-148
00074 int32 RBR=-149
00075 int32 RBS=-150
00076 int32 RP=-151
00077 int32 RRC=-152
00078 int32 S=-153
00079 int32 SBAR=-154
00080 int32 SBARQ=-155
00081 int32 _SBJ=-156
00082 int32 SINV=-157
00083 int32 SQ=-158
00084 int32 SYM=-159
00085 int32 _TMP=-160
00086 int32 TO=-161
00087 int32 _TPC=-162
00088 int32 _TTL=-163
00089 int32 UCP=-164
00090 int32 UH=-165
00091 int32 VB=-166
00092 int32 VBD=-167
00093 int32 VBG=-168
00094 int32 VBN=-169
00095 int32 VBP=-170
00096 int32 VBZ=-171
00097 int32 _VOC=-172
00098 int32 VP=-173
00099 int32 WDT=-174
00100 int32 WHADJP=-175
00101 int32 WHADVP=-176
00102 int32 WHNP=-177
00103 int32 WHPP=-178
00104 int32 WP=-179
00105 int32 WP_S=-180
00106 int32 WRB=-181
00107 int32 X=-182
00108 # These stay out for testing purposes.  We want to make sure tags[] is working properly.
00109 # # int32 SENTENCE_CLOSER=183  # .;?
00110 # # int32 COMMA=184
00111 # # int32 COLON=185
00112 # # int32 LPAREN=186
00113 # # int32 RPAREN=187
00114 
00115 # .
00116 # ,
00117 # :
00118 # (
00119 # )
00120 
00121 
00122 # #  Pound sign
00123 # $  Dollar sign
00124 # .  Sentence-final punctuation
00125 # ,  Comma
00126 # :  Colon, semi-colon
00127 # (  Left bracket character
00128 # )  Right bracket character
00129 # "  Straight double quote
00130 # `  Left open single quote
00131 # "  Left open double quote
00132 # '  Right close single quote
00133 # "  Right close double quote
00134 # ``
00135 # ''
00136 
00137 
00138 """
00139   # Pseudo-constants
00140   ROOT = -100
00141   ADJP = -101
00142   _ADV = -102
00143   ADVP = -103
00144   _BNF = -104
00145   CC = -105
00146   CD = -106
00147   _CLF = -107
00148   _CLR = -108
00149   CONJP = -109
00150   _DIR = -110
00151   DT = -111
00152   _DTV = -112
00153   EX = -113
00154   _EXT = -114
00155   FRAG = -115
00156   FW = -116
00157   _HLN = -117
00158   IN = -118
00159   INTJ = -119
00160   JJ = -120
00161   JJR = -121
00162   JJS = -122
00163   _LGS = -123
00164   _LOC = -124
00165   LS = -125
00166   LST = -126
00167   MD = -127
00168   _MNR = -128
00169   NAC = -129
00170   NN = -130
00171   NNS = -131
00172   NNP = -132
00173   NNPS = -133
00174   _NOM = -134
00175   NP = -135
00176   NX = -136
00177   PDT = -137
00178   POS = -138
00179   PP = -139
00180   _PRD = -140
00181   PRN = -141
00182   PRP = -142
00183   _PRP = -143
00184   PRP_S = -144
00185   PRT = -145
00186   _PUT = -146
00187   QP = -147
00188   RB = -148
00189   RBR = -149
00190   RBS = -150
00191   RP = -151
00192   RRC = -152
00193   S = -153
00194   SBAR = -154
00195   SBARQ = -155
00196   _SBJ = -156
00197   SINV = -157
00198   SQ = -158
00199   SYM = -159
00200   _TMP = -160
00201   TO = -161
00202   _TPC = -162
00203   _TTL = -163
00204   UCP = -164
00205   UH = -165
00206   VB = -166
00207   VBD = -167
00208   VBG = -168
00209   VBN = -169
00210   VBP = -170
00211   VBZ = -171
00212   _VOC = -172
00213   VP = -173
00214   WDT = -174
00215   WHADJP = -175
00216   WHADVP = -176
00217   WHNP = -177
00218   WHPP = -178
00219   WP = -179
00220   WP_S = -180
00221   WRB = -181
00222   X = -182
00223 
00224   __slots__ = ['tag','parent_id','score','word_index']
00225   _slot_types = ['int32','int32','float64','int32']
00226 
00227   def __init__(self, *args, **kwds):
00228     """
00229     Constructor. Any message fields that are implicitly/explicitly
00230     set to None will be assigned a default value. The recommend
00231     use is keyword arguments as this is more robust to future message
00232     changes.  You cannot mix in-order arguments and keyword arguments.
00233 
00234     The available fields are:
00235        tag,parent_id,score,word_index
00236 
00237     :param args: complete set of field values, in .msg order
00238     :param kwds: use keyword arguments corresponding to message field names
00239     to set specific fields.
00240     """
00241     if args or kwds:
00242       super(SquashedParseTreeNode, self).__init__(*args, **kwds)
00243       #message fields cannot be None, assign default values for those that are
00244       if self.tag is None:
00245         self.tag = 0
00246       if self.parent_id is None:
00247         self.parent_id = 0
00248       if self.score is None:
00249         self.score = 0.
00250       if self.word_index is None:
00251         self.word_index = 0
00252     else:
00253       self.tag = 0
00254       self.parent_id = 0
00255       self.score = 0.
00256       self.word_index = 0
00257 
00258   def _get_types(self):
00259     """
00260     internal API method
00261     """
00262     return self._slot_types
00263 
00264   def serialize(self, buff):
00265     """
00266     serialize message into buffer
00267     :param buff: buffer, ``StringIO``
00268     """
00269     try:
00270       _x = self
00271       buff.write(_struct_2idi.pack(_x.tag, _x.parent_id, _x.score, _x.word_index))
00272     except struct.error as se: self._check_types(se)
00273     except TypeError as te: self._check_types(te)
00274 
00275   def deserialize(self, str):
00276     """
00277     unpack serialized message in str into this message instance
00278     :param str: byte array of serialized message, ``str``
00279     """
00280     try:
00281       end = 0
00282       _x = self
00283       start = end
00284       end += 20
00285       (_x.tag, _x.parent_id, _x.score, _x.word_index,) = _struct_2idi.unpack(str[start:end])
00286       return self
00287     except struct.error as e:
00288       raise genpy.DeserializationError(e) #most likely buffer underfill
00289 
00290 
00291   def serialize_numpy(self, buff, numpy):
00292     """
00293     serialize message with numpy array types into buffer
00294     :param buff: buffer, ``StringIO``
00295     :param numpy: numpy python module
00296     """
00297     try:
00298       _x = self
00299       buff.write(_struct_2idi.pack(_x.tag, _x.parent_id, _x.score, _x.word_index))
00300     except struct.error as se: self._check_types(se)
00301     except TypeError as te: self._check_types(te)
00302 
00303   def deserialize_numpy(self, str, numpy):
00304     """
00305     unpack serialized message in str into this message instance using numpy for array types
00306     :param str: byte array of serialized message, ``str``
00307     :param numpy: numpy python module
00308     """
00309     try:
00310       end = 0
00311       _x = self
00312       start = end
00313       end += 20
00314       (_x.tag, _x.parent_id, _x.score, _x.word_index,) = _struct_2idi.unpack(str[start:end])
00315       return self
00316     except struct.error as e:
00317       raise genpy.DeserializationError(e) #most likely buffer underfill
00318 
00319 _struct_I = genpy.struct_I
00320 _struct_2idi = struct.Struct("<2idi")


stanford_parser_msgs
Author(s): Brian Thomas
autogenerated on Fri Dec 6 2013 20:37:07