Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6875477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:19:42+00:00 2026-05-27T04:19:42+00:00

I am using the Stanford coreNLP ( http://nlp.stanford.edu/software/corenlp.shtml ) in order to parse sentences

  • 0

I am using the Stanford coreNLP ( http://nlp.stanford.edu/software/corenlp.shtml ) in order to parse sentences and extract dependencies between the words.

I have managed to create the dependencies graph like in the example in the supplied link, but I don’t know how to work with it. I can print the entire graph using the toString() method, but the problem I have is that the methods that search for certain words in the graph, such as getChildList, require an IndexedWord object as a parameter. Now, it is clear why they do because the nodes of the graph are of IndexedWord type, but it’s not clear to me how I create such an object in order to search for a specific node.

For example: I want to find the children of the node that represents the word “problem” in my sentence. How I create an IndexWord object that represents the word “problem” so I can search for it in the graph?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T04:19:42+00:00Added an answer on May 27, 2026 at 4:19 am

    In general, you shouldn’t be creating your own IndexedWord objects. (These are used to represent “word tokens”, i.e., particular words in a text, not “word types”, and so asking for the word “problem” — a word type — isn’t really valid; in particular, a sentence could have multiple tokens of this word type.)

    There are a couple of convenience methods that let you do what you want:

    • sg.getNodeByWordPattern(String pattern)
    • sg.getAllNodesByWordPattern(String pattern)

    The first is a little dangerous, since it just returns the first IndexedWord matching the pattern, or null if there are none. But it’s most directly what you asked for.

    Some other methods to start from are:

    • sg.getFirstRoot() to find the (first, usually only) root of the graph and then to navigate down from there, such as by using the sg.getChildren(root) method.
    • sg.vertexSet() to get all of the IndexWord objects in the graph.
    • sg.getNodeByIndex(int) if you already know the input sentence, and therefore can ask for words by their integer index.

    Commonly these methods leave you iterating through nodes. Really, the first two get…Node… methods just do the iteration for you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Stanford's NLP parser (http://nlp.stanford.edu/software/lex-parser.shtml) to split a block of text into
I am trying to compile VRip in Ubuntu 10.04, using the site http://graphics.stanford.edu/software/vrip/guide/ as
I'm using Stanford Parser to parse the dependence relations between pair of words, but
Using the method presented here: http://cslibrary.stanford.edu/110/BinaryTrees.html#java 12. countTrees() Solution (Java) /** For the key
I want to create an event calendar application similar to the site http://events.stanford.edu/ using
I'm currently parsing Arabic text using the following command: java -mx1500m edu.stanford.nlp.parser.lexparser.LexicalizedParser \ -cp
I'm building a NLP application and have been using the Stanford Parser for most
I tried to parse a sentence using Stanford parser, but I get the exception.
I'm trying to check spelling accuracy of text samples using the Stanford NLP. It's
I am using an NLP library (Stanford NER) that throws java.lang.OutOfMemoryError errors for rare

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.