Skip to content

Commit

Permalink
Merge branch 'master' in 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
SimGus committed Oct 8, 2019
2 parents c08e78d + 92ffd0d commit 6ffa9d3
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- New opposite random generation modifier (using syntax `[unit?!randgen name]`)

### Fixed
- Entity positions were incorrectly updated in some cases (issue [#22](https://github.com/SimGus/Chatette/issues/22))

## [1.6.0] - 2019-09-18
### Added
- New adapter to output a *Markdown* file that can be used as input for *Rasa NLU*
Expand Down
2 changes: 1 addition & 1 deletion chatette/modifiers/randgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def concat_examples_with_randgen(example, example_to_append):
@pre: the randgen mappings of those examples can be merged.
"""
result = deepcopy(example)
result.append(example_to_append)
result.append(deepcopy(example_to_append))
mapping = merge_randgen_mappings(example, example_to_append)
if mapping is not None:
setattr(result, RANDGEN_MAPPING_KEY, mapping)
Expand Down
Binary file added public/uml/1.6.0/classes_No_Name.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/uml/1.6.0/packages_No_Name.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
%[askPopulation]('training': '5')
~[greet?] ~[population] @[city]

@[city]
new york
tokyo

~[greet]
hi
hello

~[population]
what is the population of
how many people are there in

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Contains all possible examples for the Chatette template file with the same name.
askPopulation>>>how many people are there in new york
askPopulation>>>how many people are there in tokyo
askPopulation>>>what is the population of new york
askPopulation>>>what is the population of tokyo
askPopulation>>>hello how many people are there in new york
askPopulation>>>hello how many people are there in tokyo
askPopulation>>>hello what is the population of new york
askPopulation>>>hello what is the population of tokyo
askPopulation>>>hi how many people are there in new york
askPopulation>>>hi how many people are there in tokyo
askPopulation>>>hi what is the population of new york
askPopulation>>>hi what is the population of tokyo

23 changes: 22 additions & 1 deletion tests/system-testing/test_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,8 @@ def test_generate_nb_training(self):
"tests/system-testing/inputs/generate-nb/training-only/"
input_filenames = [
"only-words.chatette", "words-and-groups.chatette",
"alias.chatette", "include.chatette", "slot.chatette"
"alias.chatette", "include.chatette", "slot.chatette",
"bugfixes/bug-22-slot-position.chatette"
]
for filename in input_filenames:
file_path = os.path.join(input_dir_path, filename)
Expand Down Expand Up @@ -278,6 +279,26 @@ def test_generate_nb_training(self):
str(facade.train_examples)
)

def test_bug_fixes(self):
facade = ChatetteFacade.get_or_create()

file_path = "tests/system-testing/inputs/generate-nb/training-only/bugfixes/bug-22-slot-position.chatette"
facade.run(file_path)
for ex in facade.train_examples:
for entity in ex.entities:
if entity._len != 5 and entity._len != 8:
pytest.fail(
"Incorrect length for entity '" + str(entity.value) + \
"': " + str(entity._len)
)
if entity._start_index < 26 and entity._start_index > 35:
pytest.fail(
"Incorrect starting index for entity '" + \
str(entity.value) + "' in '" + str(ex.text) + \
"': " + str(entity._start_index)
)


def test_generate_nb_testing(self):
"""
Tests templates that generate a subset of all possible examples
Expand Down

0 comments on commit 6ffa9d3

Please sign in to comment.