Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
dll
 
 
doc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

EmotionML library for C#

With the help of this library you can parse and create EmotionML with C#. Both, EmotionML documents and fragments, are supported. Furthermore you can work with the represented emotions a little bit.

You can download this library in a compiled format.

Using of this library

Parsing of EmotionML

You can parse a whole EmotionML document or only parts of it with the build in EmotionML parser.

Load by XmlDocument:

XmlDocument emotionmlDoc = new XmlDocument();
emotionmlDoc.Load("your.emotionml");
Parser emotionmlParser = new Parser(emotionmlDoc);

Load by string:

Parser emotionmlParser = new Parser(emotionmlString);

After that you can access the parts of EmotionML document you need.

Whole EmotionML document:

EmotionMLDocument emotionmlDoc = emotionmlParser.getEmotionMLDocument();

List of emotions:

List<Emotion> emotionList = emotionmlParser.getEmotions();

Single emotion:

Emotion emotion = emotionmlParser.getSingleEmotion();

List of vocabularies:

List<Vocabulary> vocabularyList = emotionmlParser.getVocabularies();

Single vocabulary:

Vocabulary vocabulary = emotionmlParser.getSingleVocabulary();

Creating EmotionML

You can create XmlDocument instances with the method ToDom() and XML with the method ToXml().

Add some emotions to an EmotionML document and output it as XML:

EmotionMLDocument emodoc = new EmotionMLDocument();
emodoc.addEmotion(emotion1);
emodoc.addEmotion(emotion2);

Console.Write(emodoc.ToXml());

Output single emotion as XmlDocument:

emotion1.ToDom();

Internal structures

In general every XML tag has it's own class. Furthermore there is a directory resources with some XSLT for validation and a file with the default vocabularies of EmotionML. This files are accessible via Helper::loadInternalResource(). However, here is a simplified class diagram:

https://raw.github.com/gfobe/EmotionML-Lib-CSharp/12c371608a52035d0195ec45310c16cb0d91530b/doc/class-diagramm-EmotionML-lib_easy.png

Next steps

  • integration of automated tests
  • references between emotions and vocabularies
  • improvements in comparisons

Other things

License: FreeBSD

About

Library to parse and create EmotionML with C#.

Resources

Releases

No releases published

Packages

No packages published

Languages