Commit bd466ea9 authored by Elias Englmeier's avatar Elias Englmeier
Browse files
parents 763f1f1f dfe38a42
......@@ -24,3 +24,14 @@ server:
adminConnectors:
- type: http
port: 9001
# Database settings.
database:
# the name of the JDBC driver
driverClass: com.mysql.jdbc.Driver
# the username
user: root
# the password
password: *******
# the JDBC URL; the database is called DWGettingStarted
url: jdbc:mysql://localhost:3306/ttmms
\ No newline at end of file
......@@ -47,6 +47,19 @@
<groupId>io.dropwizard</groupId>
<artifactId>dropwizard-assets</artifactId>
</dependency>
<dependency>
<groupId>io.dropwizard</groupId>
<artifactId>dropwizard-hibernate</artifactId>
</dependency>
<dependency>
<groupId>io.dropwizard</groupId>
<artifactId>dropwizard-migrations</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.36</version>
</dependency>
<dependency>
<groupId>edu.stanford.nlp</groupId>
<artifactId>stanford-corenlp</artifactId>
......
package org.tmms.classification.api;
import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* A class to store Lemmatization data.
*/
@Entity
@Table(name = "lemmas")
@NamedQueries({ @NamedQuery(name = "org.tmms.classification.api.Lemma.findAll", query = "select l from Lemma l"), })
public class Lemma implements Serializable {
/**
* Entity's unique identifier.
*/
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private long id;
/**
* Input data.
*/
private String data;
/**
* Lemmatization result.
*/
private String lemma;
/**
* A no-argument constructor.
*/
public Lemma() {
}
/**
* A constructor to create Lemmatizations. Id is not passed, cause it's
* auto-generated by RDBMS.
*@param data the input data.
*@param lemma the Lemmatization result.
*/
public Lemma(String data, String lemma) {
this.data = data;
this.lemma = lemma;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((data == null) ? 0 : data.hashCode());
result = prime * result + (int) (id ^ (id >>> 32));
result = prime * result + ((lemma == null) ? 0 : lemma.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Lemma other = (Lemma) obj;
if (data == null) {
if (other.data != null)
return false;
} else if (!data.equals(other.data))
return false;
if (id != other.id)
return false;
if (lemma == null) {
if (other.lemma != null)
return false;
} else if (!lemma.equals(other.lemma))
return false;
return true;
}
@JsonProperty
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@JsonProperty
public String getData() {
return data;
}
public void setData(String data) {
this.data = data;
}
@JsonProperty
public String getLemma() {
return lemma;
}
public void setLemma(String lemma) {
this.lemma = lemma;
}
}
package org.tmms.classification.api;
import org.hibernate.validator.constraints.Length;
import com.fasterxml.jackson.annotation.JsonProperty;
public class LemmaAnnotationResult {
private long id;
@Length(max = 3)
private String content;
public LemmaAnnotationResult(){
}
public LemmaAnnotationResult(long id, String value) {
this.id = id;
this.content = value;
}
@JsonProperty
public long getId() {
return id;
}
@JsonProperty
public String getContent() {
return content;
}
}
package org.tmms.classification.api;
import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* A class to store Named Entity Recognition data.
*/
@Entity
@Table(name = "ners")
@NamedQueries({
@NamedQuery(name = "org.tmms.classification.api.NamedEntityRecognition.findAll", query = "select n from NamedEntityRecognition n"), })
public class NamedEntityRecognition implements Serializable {
/**
* Entity's unique identifier.
*/
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private long id;
/**
* Input data.
*/
private String data;
/**
* Named Entity Recognition result.
*/
private String ner;
/**
* A no-argument constructor.
*/
public NamedEntityRecognition() {
}
/**
* A constructor to create Named Entity Recognitions. Id is not passed,
* cause it's auto-generated by RDBMS.
*
* @param data
* the input data.
* @param ner
* the Named Entity Recognition result.
*/
public NamedEntityRecognition(String data, String ner) {
this.data = data;
this.ner = ner;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((data == null) ? 0 : data.hashCode());
result = prime * result + (int) (id ^ (id >>> 32));
result = prime * result + ((ner == null) ? 0 : ner.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
NamedEntityRecognition other = (NamedEntityRecognition) obj;
if (data == null) {
if (other.data != null)
return false;
} else if (!data.equals(other.data))
return false;
if (id != other.id)
return false;
if (ner == null) {
if (other.ner != null)
return false;
} else if (!ner.equals(other.ner))
return false;
return true;
}
@JsonProperty
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@JsonProperty
public String getData() {
return data;
}
public void setData(String data) {
this.data = data;
}
@JsonProperty
public String getNer() {
return ner;
}
public void setNer(String ner) {
this.ner = ner;
}
}
package org.tmms.classification.api;
import org.hibernate.validator.constraints.Length;
import com.fasterxml.jackson.annotation.JsonProperty;
public class NamedEntityRecognitionResult {
private long id;
@Length(max = 3)
private String content;
public NamedEntityRecognitionResult(){
}
public NamedEntityRecognitionResult(long id, String value) {
this.id = id;
this.content = value;
}
@JsonProperty
public long getId() {
return id;
}
@JsonProperty
public String getContent() {
return content;
}
}
package org.tmms.classification.api;
import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* A class to store Part-Of-Speech Tagging data.
*/
@Entity
@Table(name = "poss")
@NamedQueries({
@NamedQuery(name = "org.tmms.classification.api.PartOfSpeech.findAll", query = "select p from PartOfSpeech p"), })
public class PartOfSpeech implements Serializable {
/**
* Entity's unique identifier.
*/
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private long id;
/**
* Input data.
*/
private String data;
/**
* Part-Of-Speech tagging result.
*/
private String pos;
/**
* A no-argument constructor.
*/
public PartOfSpeech() {
}
/**
* A constructor to create sentiments. Id is not passed, cause it's
* auto-generated by RDBMS.
*
* @param data
* the input data.
* @param pos
* the Part-Of-Speech tagging result.
*/
public PartOfSpeech(String data, String pos) {
this.data = data;
this.pos = pos;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((data == null) ? 0 : data.hashCode());
result = prime * result + (int) (id ^ (id >>> 32));
result = prime * result + ((pos == null) ? 0 : pos.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
PartOfSpeech other = (PartOfSpeech) obj;
if (data == null) {
if (other.data != null)
return false;
} else if (!data.equals(other.data))
return false;
if (id != other.id)
return false;
if (pos == null) {
if (other.pos != null)
return false;
} else if (!pos.equals(other.pos))
return false;
return true;
}
@JsonProperty
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@JsonProperty
public String getData() {
return data;
}
public void setData(String data) {
this.data = data;
}
@JsonProperty
public String getPos() {
return pos;
}
public void setPos(String pos) {
this.pos = pos;
}
}
package org.tmms.classification.api;
import org.hibernate.validator.constraints.Length;
import com.fasterxml.jackson.annotation.JsonProperty;
public class PartOfSpeechTaggingResult {
private long id;
@Length(max = 3)
private String content;
public PartOfSpeechTaggingResult(){
}
public PartOfSpeechTaggingResult(long id, String value) {
this.id = id;
this.content = value;
}
@JsonProperty
public long getId() {
return id;
}
@JsonProperty
public String getContent() {
return content;
}
}
package org.tmms.classification.api;
import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* A class to store sentiment data.
*/
@Entity
@Table(name = "sentiments")
@NamedQueries({
@NamedQuery(name = "org.tmms.classification.api.Sentiment.findAll", query = "select s from Sentiment s"),
@NamedQuery(name = "org.tmms.classification.api.Sentiment.findBySentiment", query = "select s from Sentiment s "
+ "where s.sentiment like :sentiment ") })
public class Sentiment implements Serializable {
/**
* Entity's unique identifier.
*/
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private long id;
/**
* Input data.
*/
private String data;
/**
* sentiment analysis result.
*/
private String sentiment;
/**
* A no-argument constructor.
*/
public Sentiment() {
}
/**
* A constructor to create sentiments. Id is not passed, cause it's
* auto-generated by RDBMS.
*
* @param data
* the input data.
* @param sentiment
* the Sentiment analysis result.
*/
public Sentiment(String data, String sentiment) {
this.data = data;
this.sentiment = sentiment;
}
// Auto-generated equals, hashCode, getters and setters.
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((data == null) ? 0 : data.hashCode());
result = prime * result + (int) (id ^ (id >>> 32));
result = prime * result + ((sentiment == null) ? 0 : sentiment.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Sentiment other = (Sentiment) obj;
if (data == null) {
if (other.data != null)
return false;
} else if (!data.equals(other.data))
return false;
if (id != other.id)
return false;
if (sentiment == null) {
if (