Skip to content

Commit e6ea5de

Browse files
committed
Added Tests and new version 8.0.0
1 parent c2c403f commit e6ea5de

File tree

3 files changed

+51
-127
lines changed

3 files changed

+51
-127
lines changed

pom.xml

Lines changed: 27 additions & 127 deletions
Original file line numberDiff line numberDiff line change
@@ -1,100 +1,26 @@
1-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1+
<project xmlns="http://maven.apache.org/POM/4.0.0"
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
23
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
34
<modelVersion>4.0.0</modelVersion>
45

56
<groupId>com.darkprograms.speech</groupId>
67
<artifactId>java-google-speech-api</artifactId>
8+
<version> 8.0.0</version>
79
<packaging>jar</packaging>
810

9-
<properties>
10-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
11-
</properties>
12-
1311
<name>java-google-speech-api</name>
1412
<url>https://github.com/goxr3plus/java-google-speech-api</url>
1513

16-
<description>
17-
The J.A.R.V.I.S. Speech API is designed to be simple and efficient, using the speech engines created by Google to provide functionality for parts of the API. Essentially, it is an API written in Java, including a recognizer, synthesizer, and a microphone capture utility. The project uses Google services for the synthesizer and recognizer. While this requires an Internet connection, it provides a complete, modern, and fully functional speech API in Java.
18-
</description>
19-
20-
<scm>
21-
<url>https://github.com/goxr3plus/java-google-speech-api</url>
22-
</scm>
23-
24-
<licenses>
25-
<license>
26-
<name>GNU GPL(v3)</name>
27-
<url>https://github.com/lkuza2/java-speech-api/blob/master/LICENSE</url>
28-
</license>
29-
</licenses>
30-
31-
<issueManagement>
32-
<system>GitHub</system>
33-
<url>https://github.com/goxr3plus/java-google-speech-api/issues</url>
34-
</issueManagement>
35-
36-
<developers>
37-
<developer>
38-
<id>https://github.com/Skylion007</id>
39-
<name>Skylion007</name>
40-
</developer>
41-
<developer>
42-
<id>https://github.com/lkuza2</id>
43-
<name>lkuza2</name>
44-
</developer>
45-
<developer>
46-
<id>https://github.com/AdamuKaapan</id>
47-
<name>AdamuKaapan</name>
48-
</developer>
49-
<developer>
50-
<id>https://github.com/duncanj</id>
51-
<name>duncanj</name>
52-
</developer>
53-
<developer>
54-
<id>https://github.com/Iegorchenkov</id>
55-
<name>Iegorchenkov</name>
56-
</developer>
57-
<developer>
58-
<id>https://github.com/xingrz</id>
59-
<name>xingrz</name>
60-
</developer>
61-
<developer>
62-
<id>https://github.com/ClusterM</id>
63-
<name>ClusterM</name>
64-
</developer>
65-
<developer>
66-
<id>https://github.com/AranHase</id>
67-
<name>AranHase</name>
68-
</developer>
69-
</developers>
70-
71-
<dependencies>
72-
<dependency>
73-
<groupId>com.github.axet</groupId>
74-
<artifactId>java-flac-encoder</artifactId>
75-
<version>0.3.8</version>
76-
</dependency>
77-
<!-- https://mvnrepository.com/artifact/com.github.cliftonlabs/json-simple -->
78-
<dependency>
79-
<groupId>org.json</groupId>
80-
<artifactId>json</artifactId>
81-
<version>20150729</version>
82-
</dependency>
83-
</dependencies>
14+
<properties>
15+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
16+
</properties>
8417

8518
<build>
8619
<plugins>
87-
<plugin>
88-
<groupId>org.apache.maven.plugins</groupId>
89-
<artifactId>maven-release-plugin</artifactId>
90-
<version>2.2.2</version>
91-
<configuration>
92-
<arguments>-Dgpg.passphrase=${gpg.passphrase}</arguments>
93-
</configuration>
94-
</plugin>
9520
<plugin>
9621
<groupId>org.apache.maven.plugins</groupId>
9722
<artifactId>maven-source-plugin</artifactId>
23+
<version>3.0.1</version>
9824
<executions>
9925
<execution>
10026
<id>attach-sources</id>
@@ -107,6 +33,7 @@
10733
<plugin>
10834
<groupId>org.apache.maven.plugins</groupId>
10935
<artifactId>maven-javadoc-plugin</artifactId>
36+
<version>3.0.1</version>
11037
<executions>
11138
<execution>
11239
<id>attach-javadocs</id>
@@ -119,51 +46,24 @@
11946
</plugins>
12047
</build>
12148

122-
<distributionManagement>
123-
<snapshotRepository>
124-
<id>sonatype-nexus-snapshots</id>
125-
<name>Sonatype Nexus snapshot repository</name>
126-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
127-
</snapshotRepository>
128-
<repository>
129-
<id>sonatype-nexus-staging</id>
130-
<name>Sonatype Nexus release repository</name>
131-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
132-
</repository>
133-
</distributionManagement>
134-
135-
<profiles>
136-
<profile>
137-
<id>release-sign-artifacts</id>
138-
<activation>
139-
<property>
140-
<name>performRelease</name>
141-
<value>true</value>
142-
</property>
143-
</activation>
144-
<build>
145-
<plugins>
146-
<plugin>
147-
<groupId>org.apache.maven.plugins</groupId>
148-
<artifactId>maven-gpg-plugin</artifactId>
149-
<version>1.4</version>
150-
<configuration>
151-
<passphrase>${gpg.passphrase}</passphrase>
152-
</configuration>
153-
<executions>
154-
<execution>
155-
<id>sign-artifacts</id>
156-
<phase>verify</phase>
157-
<goals>
158-
<goal>sign</goal>
159-
</goals>
160-
</execution>
161-
</executions>
162-
</plugin>
163-
</plugins>
164-
</build>
165-
</profile>
166-
</profiles>
49+
<dependencies>
50+
<dependency>
51+
<groupId>com.github.axet</groupId>
52+
<artifactId>java-flac-encoder</artifactId>
53+
<version>0.3.8</version>
54+
</dependency>
55+
<!-- https://mvnrepository.com/artifact/com.github.cliftonlabs/json-simple -->
56+
<dependency>
57+
<groupId>org.json</groupId>
58+
<artifactId>json</artifactId>
59+
<version>20150729</version>
60+
</dependency>
61+
<dependency>
62+
<groupId>junit</groupId>
63+
<artifactId>junit</artifactId>
64+
<version>4.12</version>
65+
<scope> test </scope>
66+
</dependency>
67+
</dependencies>
16768

168-
<version>2.1</version>
16969
</project>

src/main/java/com/darkprograms/speech/translator/GoogleTranslate.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
import java.util.List;
1212
import java.util.Locale;
1313

14+
import org.json.JSONArray;
15+
1416
/***************************************************************************************************************
1517
* An API for a Google Translation service in Java. Please Note: This API is unofficial and is not supported by Google. Subject to breakage at any
1618
* time. The translator allows for language detection and translation. Recommended for translation of user interfaces or speech commands. All
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package translator;
2+
3+
import static org.junit.Assert.assertTrue;
4+
5+
import java.io.IOException;
6+
7+
import org.junit.Test;
8+
9+
import com.darkprograms.speech.translator.GoogleTranslate;
10+
11+
public class TranslatorTest {
12+
13+
@Test
14+
public void testString() throws IOException {
15+
16+
String translatedText = GoogleTranslate.translate("Hola . Buenos días");
17+
String expecetedText = "Hi . Good Morning";
18+
19+
System.out.println(translatedText);
20+
assertTrue(translatedText.equals(expecetedText));
21+
}
22+
}

0 commit comments

Comments
 (0)