Skip to content

Commit

Permalink
SimpleNLG-DE Version 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
DaBr01 committed Oct 26, 2019
0 parents commit e828887
Show file tree
Hide file tree
Showing 68 changed files with 1,164,299 additions and 0 deletions.
461 changes: 461 additions & 0 deletions LICENSE.md

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# SimpleNLG German
SimpleNLG is a simple Java API designed to facilitate the generation of Natural Language. It was originally developed by Ehud Reiter, Professor at the [University of Aberdeen's Department of Computing Science](http://www.abdn.ac.uk/ncs/departments/computing-science/index.php) and co-founder of [Arria NLG](https://www.arria.com). This is an adaption of [SimpleNGL V4.4.8](https://github.com/simplenlg/simplenlg) to German.

As the authors of the original, English SimpleNLG library state, "SimpleNLG is intended to function as a ["realisation engine"](https://en.wikipedia.org/wiki/Realization_(linguistics)) for [Natural Language Generation](https://en.wikipedia.org/wiki/Natural-language_generation) architectures [...]".

## Current Release (German)
The current release of SimpleNLG-DE is V1.0.

## Getting Started
For instructions on how to use SimpleNLG German, please refer to the [tutorial](https://github.com/sebischair/SimpleNLG-DE/wiki).

## SimpleNLG German License
SimpleNLG is licensed under the terms and conditions of the [Mozilla Public Licence (MPL)](https://www.mozilla.org/en-US/MPL/).

## Citation information
```
@inproceedings{Braun2019SimpleNLG-DE,
title = {SimpleNLG-DE: Adapting SimpleNLG 4 to German},
author = {Daniel Braun and Kira Klimt and Daniela Schneider and Florian Matthes},
year = {2019},
booktitle = {Proceedings of the 12th International Conference on Natural Language Generation},
address = {Tokio, Japan},
organization = {Association for Computational Linguistics },
keywords = {},
pubstate = {published},
tppubtype = {inproceedings}
}
```
3 changes: 3 additions & 0 deletions src/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Manifest-Version: 1.0
Main-Class: Main

80 changes: 80 additions & 0 deletions src/Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import test.*;

import java.io.IOException;

import simplenlgde.framework.NLGFactory;
import simplenlgde.lexicon.Lexicon;
import simplenlgde.realiser.Realiser;

public class Main {

public static void main(String[] args) throws IOException {

Lexicon lexicon;
NLGFactory nlgFactory;
Realiser realiser;

lexicon = Lexicon.getDefaultLexicon();
nlgFactory = new NLGFactory(lexicon);
realiser = new Realiser(lexicon);

/*RealiserTest test1 = new RealiserTest(lexicon, nlgFactory, realiser);

ScopeDocTest test2 = new ScopeDocTest(lexicon, nlgFactory, realiser);
test2.scopeDocB_4_2();
test2.scopeDocB_4_3();
test2.reportSampeleSentences();
test2.sectorAndCountryAttributes();
test2.scopeDoc4_2_new();
test2.scopeDoc4_2_new2();
test2.scopeDoc4_3_new();

test1.testPluralizationLexicon();
test1.testregularVerbInflection();
test1.testirregularVerbInflection();
test1.testregularVerbInflectionPreterite();
test1.testirregularVerbInflectionPreterite();
test1.testAdjectiveArticleInflecion();
test1.testCommaRules();
test1.testGenitiveNouns();
test1.testDativeNouns();
test1.testAccusativeNouns();
test1.testModifiers();
test1.separableVerbsPositioning();
test1.basicSyntaxTest();
test1.testPassivePresVerbInflection();
test1.testPassiveProgressivePresVerbInflection();
test1.testPassivePretVerbInflection();
test1.adjEnumerationTest();
test1.testVerbPreModifiers();
test1.adjAdvTest();
test1.testSpecialCharacters();
test1.testFutureVerbInflection();
test1.testPerfectVerbInflection();
test1.testPerfectProgressiveVerbInflection();
test1.testModifierPositioning();
test1.testPostModsVsComplements();

ReportTest1 reportTest1 = new ReportTest1(lexicon, nlgFactory, realiser);
reportTest1.wertentwicklung();
reportTest1.anlagestrategie();

SaToSTest satosTest = new SaToSTest(lexicon, nlgFactory, realiser);
satosTest.testToS1();
satosTest.testToS2();
satosTest.testToS3();
satosTest.testToS4();
satosTest.testToS5();
satosTest.testToS6();
satosTest.testToS7();

test1.testPerfectWordOrder();
test1.testApposition();
test1.testUserSetGender();

QuestionTest test = new QuestionTest(lexicon, nlgFactory, realiser);
test.yesNoTest();
test.yesNoTest2();
test.yesNoTest3();
}
}
11 changes: 11 additions & 0 deletions src/main.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/java" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
44 changes: 44 additions & 0 deletions src/simplenlgde/features/ArticleForm.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* Contributor(s): Kira Klimt, Technical University of Munich.
*/

package simplenlgde.features;

/**
* <p>
* An enumeration representing the different forms an article can take.
* The form is recorded under the {@code Feature.ARTICLE_FORM} feature
* and applies to nouns and noun phrases.
* </p>
* @author Kira Klimt, Technical University of Munich.
* @version 4.0
*
*/
public enum ArticleForm {
/**
* The definite article. For example, the verb <em>der</em>,
* <em>die</em>, or <em>das</em>, <em>the</em> in English.
*/
DEFINITE,

/**
* The indefinite article. For example, the verb <em>ein</em>,
* <em>eine</em>, or <em>eines</em>, <em>a</em> in English.
*/
INDEFINITE,

/**
* This indicates nouns specified without any articles.
*/
NONE;
}
67 changes: 67 additions & 0 deletions src/simplenlgde/features/ClauseStatus.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is "Simplenlg".
*
* The Initial Developer of the Original Code is Ehud Reiter, Albert Gatt and Dave Westwater.
* Portions created by Ehud Reiter, Albert Gatt and Dave Westwater are Copyright (C) 2010-11 The University of Aberdeen. All Rights Reserved.
*
* Contributor(s): Ehud Reiter, Albert Gatt, Dave Wewstwater, Roman Kutlak, Margaret Mitchell.
*/

package simplenlgde.features;

/**
* <p>
* This is an enumeration of the two different types of clauses used in the
* SimplNLG package. Clauses can be either matrix or subordinate. Matrix clauses
* are not contained within any other clause and frequently span an entire
* sentence, whereas a subordinate clauses is contained within another clause.
* </p>
*
* <p>
* As an example, take the phrase, <em><b>whoever said it</b> is wrong</em>.
* This phrase has two clauses, one being the main clause and the other being a
* subordinate clause. The section in <b>bold</b> type highlights the
* subordinate clause. It is entirely contained within another clause. The
* matrix clause is of the form <em>he is wrong</em> or to be more general
* <em>X is wrong</em>. <em>X</em> can be replaced with a single subject or, as
* is the case here, by a subordinate clause.
* </p>
*
* <p>
* The clause status is recorded under the {@code Feature.CLAUSE_STATUS} feature
* and applies only to clauses.
* <hr>
* <p>
* Copyright (C) 2010, University of Aberdeen
* </p>
*
*
* @author A. Gatt and D. Westwater, University of Aberdeen.
* @version 4.0
*
*/

public enum ClauseStatus {

/**
* This enumeration represents a matrix clause. A matrix clause is not
* subordinate to any other clause and therefore sits at the top-level of
* the clause hierarchy, typically spanning the whole sentence.
*/
MATRIX,

/**
* The subordinate clauses are contained within a higher clause.
*/
SUBORDINATE;
}
146 changes: 146 additions & 0 deletions src/simplenlgde/features/DiscourseFunction.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
/*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is "Simplenlg".
*
* The Initial Developer of the Original Code is Ehud Reiter, Albert Gatt and Dave Westwater.
* Portions created by Ehud Reiter, Albert Gatt and Dave Westwater are Copyright (C) 2010-11 The University of Aberdeen. All Rights Reserved.
*
* Contributor(s): Ehud Reiter, Albert Gatt, Dave Wewstwater, Roman Kutlak, Margaret Mitchell.
*
* Contributor(s) German version: Kira Klimt, Technical University of Munich
*
*/

package simplenlgde.features;

/**
* <p>
* An enumeration representing the grammatical function that an element might
* take. The discourse function is recorded under the {@code
* Feature.DISCOURSE_FUNCTION} feature and applies to any type of {@code
* NLGElement}.
* </p>
*/

public enum DiscourseFunction {

/**
* Auxiliaries are the additional verbs added to a verb phrase to alter the
* meaning being described. For example, <em>will</em> can be added as an
* auxiliary to a verb phrase to represent the future tense of the verb,
* <em>John <b>will</b> kiss Mary</em>.
*/
AUXILIARY,

/**
* Complements are additional components that are required to complement the
* meaning of a sentence. For example,
* <em>put the bread <b>on the table</b></em> requires the complement
* <em>on the table</em> to make the clause meaningful.
*/
COMPLEMENT,

/**
* A conjunction is a word that links items together in a coordinated
* phrase. The most common conjunctions are <em>and</em> and <em>but</em>.
*/
CONJUNCTION,

/**
* Cue phrases are added to sentence to indicate document structure or flow.
* They normally do not add any semantic information to the phrase. For
* example,
* <em><b>Firstly</b>, let me just say it is an honour to be here.</em>
* <em><b>Incidentally</b>, John kissed Mary last night.</em>
*/
CUE_PHRASE,

/**
* Front modifiers are modifiers that apply to clauses. They are placed in
* the syntactical structure after the cue phrase but before the subject.
* For example, <em>However, <b>last night</b> John kissed Mary.</em>
*/
FRONT_MODIFIER,

/**
* This represents the main item of the phrase. For verb phrases, the head
* will be the main verb. For noun phrases, the head will be the subject
* noun. For adjective, adverb and prepositional phrases, the head will be
* the adjective, adverb and preposition respectively.
*/
HEAD,

/**
* This is the indirect object of a verb phrase or an additional object that
* is affected by the action performed. This is typically the recipient of
* <em>give</em>. For example, Mary is the indirect object in the phrase
* <em>John gives <b>Mary</b> the flower</em>.
*/
INDIRECT_OBJECT,

/**
* This is the object of a verb phrase and represents the item that the
* action is performed upon. For example, the flower is the object in the
* phrase <em>John gives Mary <b>the flower</b></em>.
*/
OBJECT,

/**
* Pre-modifiers, typically adjectives and adverbs, appear before the head
* of a phrase. They can apply to noun phrases and verb phrases. For
* example, <em>the <b>beautiful</b> woman</em>,
* <em>the <b>ferocious</b> dog</em>.
*/
PRE_MODIFIER,

/**
* Post-modifiers, typically adverbs, are added after the
* head of the phrase. For example, <em>John walked <b>quickly</b></em>.
*/
POST_MODIFIER,

/**
* Modifiers, typically adjectives, are added in between the
* specifier and the noun. For example, <em>Der große Hund.</b></em>.
*/
MODIFIER,

/**
* The specifier, otherwise known as the determiner, is a word that can be
* placed before a noun in a noun phrase. Example specifiers include:
* <em>the</em>, <em>some</em>, <em>a</em> and <em>an</em> as well as the
* personal pronouns such as <em>my</em>, <em>your</em>, <em>their</em>.
*/
SPECIFIER,

/**
* This is the subject of a verb phrase and represents the entity performing
* the action. For example, John is the subject in the phrase
* <em><b>John</b> gives Mary the flower.</em>
*/
SUBJECT,

/**
* The verb phrase highlights the part of a clause that forms the verb
* phrase. Verb phrases can be formed of a single verb or from a verb with a
* particle, such as <em>kiss</em>, <em>talk</em>, <em>bark</em>,
* <em>fall down</em>, <em>pick up</em>.
*/
VERB_PHRASE,

/**
* Nouns can be placed in genitive case in order to indicate a relationship to another noun,
* such as <em>Das Auto des Chefs</em>.
* Article or adjective inflection i.e. are, different to English, in German dependent on the case.
*/
GENITIVE;
}
Loading

0 comments on commit e828887

Please sign in to comment.