I need to find whether a word is verb or noun or it is both
For example, the word is \"search\" it can be both noun and a verb but stanford parser gives NN tag to i
WordNet is what you want. It provides an API to an English lexicon with possible parts-of-speech, synonyms, word senses, hypernym/hyponym relations and more.
See Yawni for a great pure-Java WordNet API.