if (ANTONYM.getKey().equals(key)) { return ANTONYM; if (HYPERNYM.getKey().equals(key)) { return HYPERNYM; if (HYPONYM.getKey().equals(key)) { return HYPONYM; if (ENTAILMENT.getKey().equals(key)) { return ENTAILMENT; if (SIMILAR_TO.getKey().equals(key)) { return SIMILAR_TO; if (MEMBER_HOLONYM.getKey().equals(key)) { return MEMBER_HOLONYM; if (SUBSTANCE_HOLONYM.getKey().equals(key)) { return SUBSTANCE_HOLONYM; if (PART_HOLONYM.getKey().equals(key)) { return PART_HOLONYM; if (MEMBER_MERONYM.getKey().equals(key)) { return MEMBER_MERONYM; if (SUBSTANCE_MERONYM.getKey().equals(key)) { return SUBSTANCE_MERONYM;
if (ANTONYM.getKey().equals(key)) { return ANTONYM; if (HYPERNYM.getKey().equals(key)) { return HYPERNYM; if (HYPONYM.getKey().equals(key)) { return HYPONYM; if (ENTAILMENT.getKey().equals(key)) { return ENTAILMENT; if (SIMILAR_TO.getKey().equals(key)) { return SIMILAR_TO; if (MEMBER_HOLONYM.getKey().equals(key)) { return MEMBER_HOLONYM; if (SUBSTANCE_HOLONYM.getKey().equals(key)) { return SUBSTANCE_HOLONYM; if (PART_HOLONYM.getKey().equals(key)) { return PART_HOLONYM; if (MEMBER_MERONYM.getKey().equals(key)) { return MEMBER_MERONYM; if (SUBSTANCE_MERONYM.getKey().equals(key)) { return SUBSTANCE_MERONYM;
return null; } else { if (key.charAt(0) == ANTONYM.getKey().charAt(0)) { return ANTONYM; if (key.charAt(0) == HYPERNYM.getKey().charAt(0)) { if (1 == key.length()) { return HYPERNYM; } else if (2 == key.length() && key.charAt(1) == INSTANCE_HYPERNYM.getKey().charAt(1)) { return INSTANCE_HYPERNYM; } else { if (key.charAt(0) == HYPONYM.getKey().charAt(0)) { if (1 == key.length()) { return HYPONYM; } else if (2 == key.length() && key.charAt(1) == INSTANCES_HYPONYM.getKey().charAt(1)) { return INSTANCES_HYPONYM; } else { if (key.charAt(0) == ENTAILMENT.getKey().charAt(0)) { return ENTAILMENT; if (key.charAt(0) == SIMILAR_TO.getKey().charAt(0)) { return SIMILAR_TO; if (key.charAt(0) == CAUSE.getKey().charAt(0)) { return CAUSE; if (key.charAt(0) == PARTICIPLE_OF.getKey().charAt(0)) {
return null; } else { if (key.charAt(0) == ANTONYM.getKey().charAt(0)) { return ANTONYM; if (key.charAt(0) == HYPERNYM.getKey().charAt(0)) { if (1 == key.length()) { return HYPERNYM; } else if (2 == key.length() && key.charAt(1) == INSTANCE_HYPERNYM.getKey().charAt(1)) { return INSTANCE_HYPERNYM; } else { if (key.charAt(0) == HYPONYM.getKey().charAt(0)) { if (1 == key.length()) { return HYPONYM; } else if (2 == key.length() && key.charAt(1) == INSTANCES_HYPONYM.getKey().charAt(1)) { return INSTANCES_HYPONYM; } else { if (key.charAt(0) == ENTAILMENT.getKey().charAt(0)) { return ENTAILMENT; if (key.charAt(0) == SIMILAR_TO.getKey().charAt(0)) { return SIMILAR_TO; if (key.charAt(0) == CAUSE.getKey().charAt(0)) { return CAUSE; if (key.charAt(0) == PARTICIPLE_OF.getKey().charAt(0)) {
/** * This method updates RelatedForms of all LexicalEntries provided by the {@link LexicalEntryGenerator} * @see LexicalEntry * @see RelatedForm */ void updateRelatedForms() { Map<Set<Word>, LexicalEntry> mappings = lexicalEntryGenerator.getLexemeGroupLexicalEntryMaping(); // Iterate over all lexemeGroups and update the RelatedForms of corresponding LexicalEntries for(Set<Word> lexemeGroup : mappings.keySet()){ Set<RelatedForm> relatedForms = new LinkedHashSet<RelatedForm>(); // Iterate over every Lexeme and check for possible RelatedForms for(Word lexeme : lexemeGroup) { for(Pointer pointer : lexeme.getPointers()) { if(pointerTypeRelTypeMappings.containsKey(pointer.getType().getKey())){ relatedForms.add(generateRelatedForm(pointer)); } } } mappings.get(lexemeGroup).setRelatedForms(new ArrayList<RelatedForm>(relatedForms)); } }
public String toString() { return ResourceBundleSet.insertParams("[PointerType: [Label: {0}] [Key: {1}] Applies To: {2}]", new Object[]{getLabel(), getKey(), getFlagsAsString()}); }
/** * This method consumes a binding of a WordNet's synset and it's associated Uby-LMF-synset. * It updates the {@link SynsetRelations} of the Uby-LMF-synset. * @param binding the binding of two synset, with WordNet's synset as key * @see Synset * @see net.sf.extjwnl.data.Synset */ private void updateSynsetRelations(Entry<net.sf.extjwnl.data.Synset, Synset> binding){ // Create SynsetRelation for the binding List<SynsetRelation> synsetRelations = new LinkedList<SynsetRelation>(); net.sf.extjwnl.data.Synset synset = binding.getKey(); List<Pointer> pointers = synset.getPointers(); int posOrdinal = POS.getAllPOS().indexOf(synset.getPOS()); // ordinal of synset's POS // Iterate over all pointers of the WNSynset and generate the corresponding SynsetRelation for(Pointer pointer : pointers) { if(!ignoredPointerKeys.contains(pointer.getType().getKey())) { synsetRelations.add(generateSynsetRelation(pointer, posOrdinal)); } } binding.getValue().setSynsetRelations(synsetRelations); }
public String toString() { return ResourceBundleSet.insertParams("[PointerType: [Label: {0}] [Key: {1}] Applies To: {2}]", new Object[]{getLabel(), getKey(), getFlagsAsString()}); }
char c = pointer.getType().getKey().charAt(0); if (';' == c || '-' == c || '@' == c || '~' == c) { pt = PointerType.getPointerTypeForKey(Character.toString(c)); result.append(pointerTypes.size()).append(' '); // p_cnt for (PointerType pointerType : pointerTypes) { result.append(pointerType.getKey()).append(' ');
char c = pointer.getType().getKey().charAt(0); if (';' == c || '-' == c || '@' == c || '~' == c) { pt = PointerType.getPointerTypeForKey(Character.toString(c)); result.append(pointerTypes.size()).append(' '); // p_cnt for (PointerType pointerType : pointerTypes) { result.append(pointerType.getKey()).append(' ');
/** * This method updates SenseRelations of the Sense associated with the consumed lexeme. * @see Sense * @see SenseRelation * @see Word */ private void updateSenseRelations(Word lexeme) { SenseGenerator senseGenerator = lexicalEntryGenerator.getSenseGenerator(); Sense sense = senseGenerator.getSense(lexeme); List<SenseRelation> senseRelations = new LinkedList<SenseRelation>(); for(Pointer pointer : lexeme.getPointers()){ if(pointerTypeRelNameMappings.containsKey(pointer.getType().getKey())) { senseRelations.add(createSenseRelation(pointer)); } } sense.setSenseRelations(senseRelations); }
for (Pointer pointer : pointers) { synsetPointerStmt.setInt(1, nextId()); synsetPointerStmt.setString(3, pointer.getType().getKey()); synsetPointerStmt.setLong(4, pointer.getTargetOffset()); synsetPointerStmt.setString(5, pointer.getTargetPOS().getKey());
for (Pointer pointer : pointers) { synsetPointerStmt.setInt(1, nextId()); synsetPointerStmt.setString(3, pointer.getType().getKey()); synsetPointerStmt.setLong(4, pointer.getTargetOffset()); synsetPointerStmt.setString(5, pointer.getTargetPOS().getKey());
for (Pointer p : synset.getPointers()) { result.append(p.getType().getKey()).append(' ');
for (Pointer p : synset.getPointers()) { result.append(p.getType().getKey()).append(' ');
/** * This method consumes a lexical pointer and generates the associated RelatedForm, defined in Uby-LMF * @param pointer WordNet's lexical pointer * @return RelatedForm associated with the consumed pointer * @see RelatedForm * @see Pointer */ private RelatedForm generateRelatedForm(Pointer pointer){ RelatedForm relatedForm = new RelatedForm(); // setting RelationType ERelTypeMorphology relType = getRelType(pointer.getType().getKey(), POS.getAllPOS().indexOf(pointer.getSource().getPOS())); relatedForm.setRelType(relType); // setting targetSense Word targetLexeme = (Word) pointer.getTarget(); relatedForm.setTargetSense(lexicalEntryGenerator.getSenseGenerator().getSense(targetLexeme)); // setting targeted LexicalEntry LexicalEntry targetLexicalEntry = lexicalEntryGenerator.getLexicalEntry(targetLexeme); if (targetLexicalEntry == null) throw new NullPointerException("Unable to find target lexical entry of related form for " + targetLexeme); relatedForm.setTargetLexicalEntry(targetLexicalEntry); return relatedForm; }
/** * This method creates a SenseRelation based on the consumed WordNet-pointer * @param pointer WordNet's {@link Pointer} * @return instance of {@link SenseRelation}-class associated with the consumed pointer */ private SenseRelation createSenseRelation(Pointer pointer){ SenseRelation senseRelation = new SenseRelation(); // Setting the target Word target = (Word) pointer.getTarget(); senseRelation.setTarget(lexicalEntryGenerator.getSenseGenerator().getSense(target)); String pointerKey = pointer.getType().getKey(); int posOrdinal = POS.getAllPOS().indexOf(pointer.getSource().getPOS()); // setting RelationName String relName = getRelName(pointerKey, posOrdinal); senseRelation.setRelName(relName); // settin relation type ERelTypeSemantics relType = getRelType(pointerKey, posOrdinal); senseRelation.setRelType(relType); return senseRelation; }
String pointerSymbol = pointer.getType().getKey(); ERelTypeSemantics relType = getRelType(pointerSymbol, posOrdinal);