wordnet

Python - WordNet NLTK KeyError

假如想象 提交于 2019-12-25 07:48:25
问题 I really don`t get it. I´m using WordNet and I get in trouble. I call the following method with strings like that: F2F - Process started, Create planning data, Create a goods receipt, Goods receipt created def lemmatise(word, pos=NOUN): return WordNetLemmatizer().lemmatize(word, pos) This one calls the next method: def lemmatize(self, word, pos=NOUN): lemmas = wordnet._morphy(word, pos) return min(lemmas, key=len) if lemmas else word And the method morphy() is where the error says that the

Runtime error in using wordnet through JWNL, error in the props file

不打扰是莪最后的温柔 提交于 2019-12-25 06:46:05
问题 hey i've tried this in netbeans but it won't work it gives me the same error no matter what i do! can anyone help? JWNL.initialize(new FileInputStream("C:\\Users\\Desktop\\file_properties.xml")); wordnet = Dictionary.getInstance(); IndexWord word = wordnet.getIndexWord(POS.VERB,"run"); Synset[] senses = word.getSenses(); for (int i = 0; i < senses.length; i++) { System.out.println(word + ": " + senses[i].getGloss()); } and getting missing file exception : Exception in thread "main" net.didion

Regarding the assets folder and environment variables on android

蓝咒 提交于 2019-12-25 02:08:53
问题 My code reads package com.fyp.jwi; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.MalformedURLException; import java.net.URL; import edu.mit.jwi.Dictionary; import edu.mit.jwi.IDictionary; import edu.mit.jwi.item.IIndexWord; import edu.mit.jwi.item.IWord; import edu.mit.jwi.item.IWordID; import edu.mit.jwi.item.POS; import android.os.Bundle; import android.app.Activity; import android.view.Menu; public class MainActivity extends Activity {

Access WordNet dict files in Android app

折月煮酒 提交于 2019-12-23 10:07:30
问题 I'm writing a word game in Android. It's my first app so my knowledge is almost non-existent. What I would like to do is use JWI to access the WordNet dictionary. This requires specifying the WordNet dictionary's file path. From what I've read, Android "assets" are not available via a simple file path, but what JWI requires to initialize the WordNet dictionary API is a URL to the disk location of the dictionary files. So, what is the best course of action? Should I copy the assets at startup

nlp - How to detect if a word in a sentence is pointing to a color/body part /vehicle

随声附和 提交于 2019-12-23 02:22:14
问题 So as the title suggests I would like to know if a certain word in a sentence is pointing to 1] A color The grass is green. Hence "green" is color 2] A body part Her hands are soft Hence "hands" is a body part 3] A vehicle I am driving my car on the causeway Hence "car" is a vehicle In similar problems, parsers are one of the possible effective solutions. Stanford parser for example was suggested to a similar question How to find if a word in a sentence is pointing to a city Now the problem

How to find the “lexical file” in Wordnet?

扶醉桌前 提交于 2019-12-22 07:01:35
问题 If you look at the original Wordnet search and select "Display options: Show Lexical File Info", you'll see an extremely useful classification of words called lexical file . Eg for "filling" we have: <noun.substance>S: (n) filling, fill (any material that fills a space or container) <noun.process>S: (n) filling (flow into something (as a container)) <noun.food>S: (n) filling (a food mixture used to fill pastry or sandwiches etc.) <noun.artifact>S: (n) woof, weft, filling, pick (the yarn woven

What's the difference between WordNet 3.1 and WordNet 3.0?

送分小仙女□ 提交于 2019-12-22 04:51:58
问题 There doesn't seem to be a changelog or something of that sort available at wordnet.princeton.edu 回答1: To add to @abarisone's answer, the actual synset IDs themselves can differ between WordNet 3.0 and WordNet 3.1 :( For example, in WordNet 3.1 a chair is 103005231-n. However, in WordNet 3.0 it was 103001627-n . But you cannot look that up in http://wordnet-rdf.princeton.edu/wn31/103001627-n nor http://wordnet-rdf.princeton.edu/wn30/103001627-n, but instead you need to use http://wordnet-rdf

Calling wordnet from php (Wordnet class or API for PHP)

本小妞迷上赌 提交于 2019-12-21 05:37:06
问题 I am trying to write a program to find similarity between two documents, and since im using only english, I decided to use wordnet, but I cannot find a way to link the wordnet with php, I cannot find any wordnet api from php. I saw in the forum some one said (Spudley) he called wordnet from php (using shell_exec() function), Thesaurus class or API for PHP [edited] I would really like to know a method used or some example code, a tutorial perhaps to start using the wordnet with php. many

Using Sentiwordnet 3.0

回眸只為那壹抹淺笑 提交于 2019-12-21 02:22:22
问题 I plan on using Sentiwordnet 3.0 for Sentiment classification. Could someone clarify as to what the numbers associated with words in Sentiwordnet represent? For e.g. what does 5 in rank#5 mean? Also for POS what is the letter used to represent adverbs? Im assuming 'a' is adjectives. I could not find an explanation either on their site or on other sites. 回答1: I found the answer. Seems like the number notation comes form Wordnet. It represents the rank in which the given word is commonly used.

Is it possible to speed up Wordnet Lemmatizer?

旧时模样 提交于 2019-12-20 12:15:14
问题 I'm using the Wordnet Lemmatizer via NLTK on the Brown Corpus (to determine if the nouns in it are used more in their singular form or their plural form). i.e. from nltk.stem.wordnet import WordNetLemmatizer l = WordnetLemmatizer() I've noticed that even the simplest queries such as the one below takes quite a long time (at least a second or two). l("cats") Presumably this is because a web connection must be made to Wordnet for each query?.. I'm wondering if there is a way to still use the