I was given a project to write a java program that uses a parser to separate a sentence and produce a graph for that sentence? Parser is an application which can be downloaded. Now how can I integrate the parser with java program? What commands I can use?
Guru Vuyyur wrote:I was given a project to write a java program that uses a parser to separate a sentence and produce a graph for that sentence? Parser is an application which can be downloaded. Now how can I integrate the parser with java program? What commands I can use?
Welcome to CodeRanch!
I didn't understand what is meant by 'produce a graph for that sentence'. However, let us not focus on that for now.
I would like to ask a couple of questions:
1) What is the nature of this utility? Is is a jar, or executable? Which platform?
2) Does it exposes any APIs, or any way to get input and return output?
Unless we don't know answers for those, its not easy to comment on integrating Java code with that utility.
First, we need to understand if it is possible or not, and then we can think of how to do it.
i have to develop a project in java that uses a stanford parser to seperate the setences and has to generate a graph that shows the relation between the words in a sentence. for eg: Ohio is located in America output:
output is shown in the image.
the image shows the graph. but the output need not be the same but it has to show relation between the words in any graph form. The graph can be generated using Jgraph,Jung. But initially i have to integrate the parser software into my program. So how can i integrate a pareser??
It's been a week. so I assume you have had an opportunity to check out the parser libaries I mentioned. Do those not fit your requirements? They don't know about relationships between different kinds of words, that's for sure. If that's what you're looking for, then I don't know any soution for that. But you said "Parser is an application which can be downloaded. " - does that mean you already know which parser you should be using?
Stanford parser is used to separate a sentence to words and also tells the nature of word like noun,pronoun,verb etc. and is a file downloadable as Zip,and it has jar files. I need to build the path using the jar files of this parser and then i can use this parser in my program to separate any sentence. After i build the path with jar files, how can i use this parser in program to do its functions. I need the code that makes use of he parser jar files,takes Sentence as input and generates the output ie words and their nature(noun,pronoun,verb) etc.
For eg: Input- " My dog also likes eating Sasuage"
output: My PN
likes VRB etc
So you don't need a parser, because you already know which one you need to use, and have that available. If that's correct, then what exactly is your question? That "Stanford parser" you mention seems a pretty specialized piece of software, that probably very few people know. My guess would be that wherever you got it from is a good place too look for documentation and example code.
Hey, sticks and stones baby. And maybe a wee mention of my stuff:
Free, earth friendly heat - from the CodeRanch trailboss