JAVA RHS string value of tokens with dependency


fh2947
 

Hello

I need a little help with featuremapping of tokens with stanford dependencies.

Using the Stanford parser, it adds ‘dependencies’ as features of tokens, but the value is the token ID not the string.

What Java RHS would get the string of dependent tokens and put the string and type (ie nobj) as features of a new annotation?  

Below returns all the features of each token within the annotation set, including dependencies but the values are ID’s, for example: dependencies = [advmod(4820))]

List<Annotation> Tokens = gate.Utils.inDocumentOrder(AnnotationSet)

I would like to return Tokens only of a certain kind within the set (I.e nsubj) and add the string value of other dependent tokens to the feature map.

Many thanks in advance for your help