Skip to content

Commit

Permalink
Builder patterns for Documents
Browse files Browse the repository at this point in the history
  • Loading branch information
vasgat committed Nov 17, 2016
1 parent e282482 commit 0be7e45
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 23 deletions.
21 changes: 11 additions & 10 deletions nb-configuration.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<project-shared-configuration>
<!--
This file contains additional configuration written by modules in the NetBeans IDE.
The configuration is intended to be shared among all the users of project and
therefore it is assumed to be part of version control checkout.
Without this configuration present, some functionality in the IDE may be limited or fail altogether.
<!--
This file contains additional configuration written by modules in the NetBeans IDE.
The configuration is intended to be shared among all the users of project and
therefore it is assumed to be part of version control checkout.
Without this configuration present, some functionality in the IDE may be limited or fail altogether.
-->
<properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
<!--
Properties that influence various parts of the IDE, especially code formatting and the like.
You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
That way multiple projects can share the same settings (useful for formatting rules for example).
Any value defined here will override the pom.xml file value but is only applicable to the current project.
<!--
Properties that influence various parts of the IDE, especially code formatting and the like.
You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
That way multiple projects can share the same settings (useful for formatting rules for example).
Any value defined here will override the pom.xml file value but is only applicable to the current project.
-->
<netbeans.hint.license>apache20</netbeans.hint.license>
</properties>

</project-shared-configuration>
7 changes: 6 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>certh.iti.mklab</groupId>
<artifactId>jSimilarity</artifactId>
<version>1.0-SNAPSHOT</version>
<version>0.1</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand All @@ -16,6 +16,11 @@
<artifactId>commons-lang3</artifactId>
<version>3.4</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
<version>4.1</version>
</dependency>
</dependencies>
<name>jSimilarity</name>
</project>
23 changes: 11 additions & 12 deletions src/main/java/certh/iti/mklab/jSimilarity/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

import certh.iti.mklab.jSimilarity.documentUtils.Corpus;
import certh.iti.mklab.jSimilarity.documentUtils.TextDocument;
import certh.iti.mklab.jsimilarity.tfidf.SoftTFIDF;
import certh.iti.mklab.jsimilarity.tfidf.TFIDF;
import certh.iti.mklab.jSimilarity.tfidf.SoftTFIDF;
import certh.iti.mklab.jSimilarity.tfidf.TFIDF;

/**
*
Expand All @@ -27,16 +27,15 @@
public class Main {

public static void main(String[] args) {

TextDocument document1 = new TextDocument("Bank of China");
TextDocument document2 = new TextDocument("Bank of China Limited");
TextDocument document3 = new TextDocument("Adidas AG");
TextDocument document4 = new TextDocument("Adidas Group");
TextDocument document5 = new TextDocument("Adidas");
TextDocument document6 = new TextDocument("BMW Group");
TextDocument document7 = new TextDocument("Nike Inc");
TextDocument document8 = new TextDocument("PetroChina Company Limited");
TextDocument document9 = new TextDocument("PetroChina Comany");
TextDocument document1 = new TextDocument.Builder("Bank of China").build();
TextDocument document2 = new TextDocument.Builder("Bank of China Limited").build();
TextDocument document3 = new TextDocument.Builder("Adidas AG").build();
TextDocument document4 = new TextDocument.Builder("Adidas Group").build();
TextDocument document5 = new TextDocument.Builder("Adidas").build();
TextDocument document6 = new TextDocument.Builder("BMW Group").build();
TextDocument document7 = new TextDocument.Builder("Nike Inc").build();
TextDocument document8 = new TextDocument.Builder("PetroChina Company Limited").build();
TextDocument document9 = new TextDocument.Builder("PetroChina Comany").build();

Corpus corpus = new Corpus();
corpus.addDocument(document1);
Expand Down

0 comments on commit 0be7e45

Please sign in to comment.