-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Many small editorial tweaks like typos, spaces, line breaks etc
- Loading branch information
Showing
10 changed files
with
199 additions
and
311 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package org.chaiware.app; | ||
|
||
import java.io.IOException; | ||
|
||
import org.chaiware.emotion.EmotionalState; | ||
import org.chaiware.emotion.Empathyscope; | ||
|
||
public class TextToEmotion { | ||
|
||
/** For internal use, in order to try the app and see that it is working while developing it */ | ||
public static void main(String[] args ) { | ||
if (args.length < 1) { | ||
System.out.println("Please send an argument with the string you want to sense for emotion"); | ||
System.exit(0); | ||
} | ||
String text = args[0]; | ||
|
||
System.out.println(textToEmotion(text)); | ||
} | ||
|
||
/** Use this method in order to analyze any text for emotions */ | ||
public static EmotionalState textToEmotion(String text) { | ||
|
||
EmotionalState sentenceState = new EmotionalState(); | ||
try { | ||
sentenceState = Empathyscope.getInstance().feel(text); | ||
} catch (IOException e) { | ||
e.printStackTrace(); | ||
} | ||
|
||
return sentenceState; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.