Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

Commit

Permalink
improved documentation of the code
Browse files Browse the repository at this point in the history
  • Loading branch information
gkiril committed Sep 14, 2017
1 parent 9674891 commit 187a0fa
Show file tree
Hide file tree
Showing 46 changed files with 196 additions and 38 deletions.
6 changes: 6 additions & 0 deletions src/main/java/de/uni_mannheim/clausie/ClausIE.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@
import it.unimi.dsi.fastutil.booleans.BooleanArrayList;
import it.unimi.dsi.fastutil.objects.ObjectArrayList;

/**
* Main class for ClausIE
*
* @author Luciano del Corro
* @author Kiril Gashteovski
*/
public class ClausIE {
// This should be a collection
SemanticGraph semanticGraph;
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/de/uni_mannheim/clausie/Options.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@

/** Options handles the ClausIe settings which should be loaded out of a configuration file.
*
* @date $LastChangedDate: 2013-04-24 11:35:23 +0200 (Wed, 24 Apr 2013) $
* @version $LastChangedRevision: 739 $ */
* @author Luciano del Corro
* @author Kiril Gashteovski
*/
public class Options {
// informatin
public Dictionary dictCopular;
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/de/uni_mannheim/clausie/clause/Clause.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
/**
* A clause is a basic unit of a sentence. In ClausIE, a clause consists of a
* set of constituents (at least a subject and a verb) and a type.
*
* @author Luciano del Corro
* @author Kiril Gashteovski
*/
public class Clause {
// -- Type definition
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
*
* {@code detectClauses} first detects the type of clause to be generated based on syntactic relations
* and once a clause is detected a given method is used to create a {@link Clause}.
*
* @author Luciano del Corro
* @author Kiril Gashteovski
*
*/
public class ClauseDetector {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
* the source of a significant loss in precision by ClausIE.
*
* Code is not clean or optimally efficient. More work needs to be done in how to handle CCs.
*
* @author Luciano del Corro
* @author Kiril Gashteovski
*
*/
public class ProcessConjunctions {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@

import edu.stanford.nlp.ling.IndexedWord;

/** A constituent of a clause. */
/**
* A constituent of a clause.
*
* @author Luciano del Corro
* @author Kiril Gashteovski
*
*/
public abstract class Constituent {

// -- types -----------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
* Note that the {@link SemanticGraph} may or may not match the graph of the input sentences or the
* other constituents of the same clause. For example, the semantic graphs are modified when
* processing of coordinating conjunctions.
*
* @author Luciano del Corro
* @author Kiril Gashteovski
*/
public class IndexedConstituent extends Constituent {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@
import de.uni_mannheim.clausie.phrase.Phrase;
import edu.stanford.nlp.ling.IndexedWord;

/** A phrase expression of a constituent. The constituent is represented as a Phrase */
/**
* A phrase expression of a constituent. The constituent is represented as a Phrase
*
* @author Kiril Gashteovski
*
*/
public class PhraseConstituent extends Constituent {
/** The constituent as a phrase **/
private Phrase phrase;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
* Note that the xcomp relation refers to a clause with an external subject.
* The constituent stores the set of clauses that can be derived from the xcomp
* clause.
*
* @date $LastChangedDate: 2013-04-23 00:04:28 +0200 (Tue, 23 Apr 2013) $
* @version $LastChangedRevision: 734 $
*
* @author Luciano del Corro
* @author Kiril Gashteovski
*
*/
public class XcompConstituent extends IndexedConstituent {

Expand Down
9 changes: 9 additions & 0 deletions src/main/java/de/uni_mannheim/clausie/phrase/Phrase.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@
import de.uni_mannheim.constant.SEPARATOR;
import de.uni_mannheim.utils.coreNLP.CoreNLPUtils;

/**
* An object representing a phrase
* @param: wordList: A list of words of the phrase
* @param: phraseGraph: the dependency parse graph of the phrase
* @param: root: the root of the phrase
* @param: tds: list of typed dependencies for the phrase
*
* @author Kiril Gashteovski
*/
public class Phrase {
/** A list of words of the phrase **/
protected ObjectArrayList<IndexedWord> wordList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@
import it.unimi.dsi.fastutil.objects.ObjectArrayList;


/** Currently the default proposition generator generates 3-ary propositions out of a clause */
/**
* Currently the default proposition generator generates 3-ary propositions out of a clause
*
* @author Luciano del Corro
* @author Kiril Gashteovski
*
* */
public class DefaultPropositionGenerator extends PropositionGenerator {
public DefaultPropositionGenerator(ClausIE clausIE) {
super(clausIE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@

/** Stores a proposition.
*
* @date $LastChangedDate: 2013-04-24 11:54:36 +0200 (Wed, 24 Apr 2013) $
* @version $LastChangedRevision: 741 $ */
* @author Luciano del Corro
* @author Kiril Gashteovski
*
*/
public class Proposition {

/** Constituents of the proposition */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@
import edu.stanford.nlp.trees.GrammaticalRelation;
import edu.stanford.nlp.semgraph.SemanticGraph;

/** Handles the generation of propositions out of a given clause */
/**
* Handles the generation of propositions out of a given clause
*
* @author Luciano del Corro
* @author Kiril Gashteovski
*
*/
public abstract class PropositionGenerator {

ClausIE clausIE;
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/de/uni_mannheim/constant/CHARACTER.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package de.uni_mannheim.constant;

/**
* @author Kiril Gashteovski
*/
public class CHARACTER {
public static String VBAR = "|";
public static String QMARK = "?";
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/de/uni_mannheim/constant/CLAUSE_TYPE.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package de.uni_mannheim.constant;

/**
* @author Kiril Gashteovski
*/
public class CLAUSE_TYPE {
public static final String ST_SV = "SV";
public static final String ST_SVA = "SVA";
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/de/uni_mannheim/constant/NE_TYPE.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package de.uni_mannheim.constant;

/**
* @author Kiril Gashteovski
*/
public class NE_TYPE {
public static final String MISC = "MISC";
public static final String PERSON = "PERSON";
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/de/uni_mannheim/constant/POS_TAG.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package de.uni_mannheim.constant;

/**
* @author Kiril Gashteovski
*/
public class POS_TAG {
public static final String CD = "CD";
public static final String DT = "DT";
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/de/uni_mannheim/constant/REGEX.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package de.uni_mannheim.constant;

/**
* @author Kiril Gashteovski
*/
public class REGEX {
/** Regex for "DT* VB+ NN+" **/
public static final String T_DT_VB_NN_END = "[{tag:/DT/}]*[{tag:/VB.*/}]+[{tag:/NN.*/}]+";
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/de/uni_mannheim/constant/SEPARATOR.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package de.uni_mannheim.constant;

/**
* @author Kiril Gashteovski
*/
public class SEPARATOR {
public static final String SPACE = " ";
public static final String TAB = "\t";
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/de/uni_mannheim/constant/WORDS.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

import de.uni_mannheim.utils.Dictionary;

/**
* @author Kiril Gashteovski
*/
public class WORDS {
// A set of non-subsective modal adjectives
public static Dictionary NON_SUBSECTIVE_JJ_MODAL;
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/de/uni_mannheim/minie/MinIE.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@
import it.unimi.dsi.fastutil.objects.ObjectArrayList;
import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet;

/**
* @author Kiril Gashteovski
*/
public class MinIE {
/** List of annotated propositions **/
private ObjectArrayList<AnnotatedProposition> propositions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@

import de.uni_mannheim.utils.coreNLP.CoreNLPUtils;

public class AnnotatedPhrase extends Phrase{
/**
* The annotated phrase is a phrase that holds some sort of annotations. For now, the only annotation
* that a phrase has are the quantities. Each phrase has a list of quantities.
*/

/**
* The annotated phrase is a phrase that holds some sort of annotations. For now, the only annotation
* that a phrase has are the quantities. Each phrase has a list of quantities.
*
* @author Kiril Gashteovski
*
*/
public class AnnotatedPhrase extends Phrase {
/** The list of quantities for the phrase **/
private ObjectArrayList<Quantity> quantities;
/** The list of dropped edges **/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
import edu.stanford.nlp.ling.IndexedWord;
import it.unimi.dsi.fastutil.objects.ObjectArrayList;

/**
* @author Kiril Gashteovski
*/
public class AnnotatedProposition {
/** The annotated proposition is a triple, a list of annotated phrases **/
private ObjectArrayList<AnnotatedPhrase> triple;
Expand Down
17 changes: 10 additions & 7 deletions src/main/java/de/uni_mannheim/minie/annotation/Attribution.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@
import de.uni_mannheim.constant.CHARACTER;
import de.uni_mannheim.constant.SEPARATOR;

/**
* A class representing the attribution
* @param attributionPhrase: a phrase containing the words for the attribution
* @param modality: the modality of the attribution (possibility or certainty)
* @param polarity: the polarity of the attribution (positive or negative)
* @param predicateVerb: the predicate verb (as a string in its lemma version)
*
* @author Kiril Gashteovski
*/

public class Attribution {
/**
* A class representing the attribution
* @param attributionPhrase: a phrase containing the words for the attribution
* @param modality: the modality of the attribution (possibility or certainty)
* @param polarity: the polarity of the attribution (positive or negative)
* @param predicateVerb: the predicate verb (as a string in its lemma version)
*/
private AnnotatedPhrase attributionPhrase;
private Modality.Type modality;
private Polarity.Type polarity;
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/de/uni_mannheim/minie/annotation/Modality.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@

import de.uni_mannheim.utils.coreNLP.CoreNLPUtils;

/**
* Annotation for modality
*
* @author Kiril Gashteovski
*/
public class Modality {
/** Annotations for modality, can be just "CERTAINTY" or "POSSIBILITY" */
public static enum Type {CERTAINTY, POSSIBILITY};
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/de/uni_mannheim/minie/annotation/Polarity.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
import de.uni_mannheim.utils.coreNLP.CoreNLPUtils;
import de.uni_mannheim.utils.Dictionary;

/**
* Annotation for polarity
*
* @author Kiril Gashteovski
*/
public class Polarity {
/** Annotations for polarity, can be just "POSTIIVE" or "NEGATIVE" */
public static enum Type {POSITIVE, NEGATIVE};
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/de/uni_mannheim/minie/annotation/Quantity.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@

import it.unimi.dsi.fastutil.objects.ObjectArrayList;

/**
* Annotation for quantity
*
* @author Kiril Gashteovski
*/
public class Quantity {
/** The quantity words */
private ObjectArrayList<IndexedWord> qWords;
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/de/uni_mannheim/minie/main/Extractor.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@

/**
* This class acts as a generic interface to the MinIE system
*
* @author Martin Achenbach
* @author Kiril Gashteovski
*/
public class Extractor {
private StanfordCoreNLP parser;
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/de/uni_mannheim/minie/main/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@

/**
* Main class that acts as a console interface to the MinIE system
*
* @author Martin Achenbach
* @author Kiril Gashteovski
*/
public class Main {
/** used MinIE mode **/
Expand Down
21 changes: 12 additions & 9 deletions src/main/java/de/uni_mannheim/minie/minimize/Minimization.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,19 @@
import it.unimi.dsi.fastutil.objects.ObjectArrayList;
import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet;

/**
* A class containing elements for minimization.
* @param phrase: the phrase being considered for minimization
* @param sg: the semantic graph of the sentence from which the phrase is derived
* @param droppedWords: set of words being dropped
* @param tPattern: reusable variable (token regex pattern)
* @param tMatcher: reusable variable (token regex matcher)
* @param mwe: dictionary of multi-word expressions
*
* @author Kiril Gashteovski
*/
public class Minimization {
/**
* A class containing elements for minimization.
* @param phrase: the phrase being considered for minimization
* @param sg: the semantic graph of the sentence from which the phrase is derived
* @param droppedWords: set of words being dropped
* @param tPattern: reusable variable (token regex pattern)
* @param tMatcher: reusable variable (token regex matcher)
* @param mwe: dictionary of multi-word expressions
*/

private AnnotatedPhrase phrase;
private SemanticGraph sg;
private ObjectOpenHashSet<String> mwe;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@

import de.uni_mannheim.utils.coreNLP.CoreNLPUtils;

/**
* @author Kiril Gashteovski
*/
public class ObjAggressiveMinimization {
/**
* Object aggressive minimization
Expand Down
Loading

0 comments on commit 187a0fa

Please sign in to comment.