Fix(Content): Corrected file and project references in README.
This commit is contained in:
11
README.md
11
README.md
@@ -16,19 +16,22 @@ NOTE: ALL INSTRUCTIONS ARE FOR LINUX.
|
||||
|
||||
## 2. Create virtual environment
|
||||
2.1. Terminal command
|
||||
- python3 -m venv env_demo_partsERP
|
||||
- python3 -m venv env_demo_braille
|
||||
|
||||
## 3. Enter virtual environment
|
||||
3.1. Terminal command
|
||||
- source env_demo_partsERP/bin/activate
|
||||
- source env_demo_braille/bin/activate
|
||||
|
||||
## 4. Install required python packages
|
||||
4.1. Terminal command
|
||||
- pip3 install -r requirements.txt
|
||||
|
||||
## 11. Run project
|
||||
11.1. Terminal command
|
||||
- python3 model_gen/main.py
|
||||
11.1. Run interactive translator tool with terminal command
|
||||
- python3 main.py
|
||||
|
||||
11.2. Run tests
|
||||
- python3 tests/all_tests.py
|
||||
|
||||
|
||||
# Gallery
|
||||
|
||||
Binary file not shown.
@@ -61,7 +61,7 @@ class Translation_Braille(BaseModel):
|
||||
break
|
||||
if known_translations.apply(lambda x: x.iloc[3] == key and x.iloc[1].value <= self.translation_proficiency_level.value, axis=1).any():
|
||||
translation_Braille = known_translations.apply(lambda x: x if (x.iloc[3] == key and x.iloc[1].value <= self.translation_proficiency_level.value) else None, axis=1).dropna().values.tolist()[0]
|
||||
braille_text.append(translation_Braille.iloc[2])
|
||||
braille_text.append(translation_Braille[2])
|
||||
index_key_start += key_length
|
||||
found_key = True
|
||||
break
|
||||
|
||||
19
tests/all_tests.py
Normal file
19
tests/all_tests.py
Normal file
@@ -0,0 +1,19 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
@author: Edward Middleton-Smith
|
||||
"""
|
||||
|
||||
from end_to_end_test_alphabet_level_translation import test_alphabet_level_translation
|
||||
from end_to_end_test_simple_word_and_groupsigns_level_translation import test_simple_words_and_groupsigns_level_translation
|
||||
from end_to_end_test_lower_contractions_level_translation import test_lower_contractions_level_translation
|
||||
from integration_test_get_all_characters import test_get_all_characters
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
# Integration test
|
||||
test_get_all_characters()
|
||||
# End to end tests
|
||||
test_alphabet_level_translation()
|
||||
test_simple_words_and_groupsigns_level_translation()
|
||||
test_lower_contractions_level_translation()
|
||||
|
||||
21
tests/end_to_end_test_alphabet_level_translation.py
Normal file
21
tests/end_to_end_test_alphabet_level_translation.py
Normal file
@@ -0,0 +1,21 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
@author: Edward Middleton-Smith
|
||||
"""
|
||||
|
||||
from context import business_objects
|
||||
from business_objects.braille_proficiency_level import Braille_Proficiency_Level
|
||||
from business_objects.character_braille import Character_Braille
|
||||
from business_objects.translation_braille import Translation_Braille
|
||||
|
||||
def test_alphabet_level_translation():
|
||||
print('Alphabet Level Translation')
|
||||
translation = Translation_Braille(
|
||||
plaintext = "Be good",
|
||||
translation_proficiency_level = Braille_Proficiency_Level(1)
|
||||
)
|
||||
translation.print()
|
||||
|
||||
if __name__ == "__main__":
|
||||
test_alphabet_level_translation()
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
@author: Edward Middleton-Smith
|
||||
"""
|
||||
|
||||
from context import business_objects
|
||||
from business_objects.braille_proficiency_level import Braille_Proficiency_Level
|
||||
from business_objects.character_braille import Character_Braille
|
||||
from business_objects.translation_braille import Translation_Braille
|
||||
|
||||
def test_lower_contractions_level_translation():
|
||||
print('Lower Contractions Level Translation')
|
||||
translation = Translation_Braille(
|
||||
plaintext = "Be good",
|
||||
translation_proficiency_level = Braille_Proficiency_Level(3)
|
||||
)
|
||||
translation.print()
|
||||
|
||||
if __name__ == "__main__":
|
||||
test_lower_contractions_level_translation()
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
@author: Edward Middleton-Smith
|
||||
"""
|
||||
|
||||
from context import business_objects
|
||||
from business_objects.braille_proficiency_level import Braille_Proficiency_Level
|
||||
from business_objects.character_braille import Character_Braille
|
||||
from business_objects.translation_braille import Translation_Braille
|
||||
|
||||
def test_simple_words_and_groupsigns_level_translation():
|
||||
print('Simple Words And Groupsigns Level Translation')
|
||||
translation = Translation_Braille(
|
||||
plaintext = "Be good",
|
||||
translation_proficiency_level = Braille_Proficiency_Level(2)
|
||||
)
|
||||
translation.print()
|
||||
|
||||
if __name__ == "__main__":
|
||||
test_simple_words_and_groupsigns_level_translation()
|
||||
|
||||
@@ -7,7 +7,7 @@ from context import business_objects
|
||||
from business_objects.character_braille import Character_Braille
|
||||
from business_objects.translation_braille import Translation_Braille
|
||||
|
||||
if __name__ == "__main__":
|
||||
def test_get_all_characters():
|
||||
braille_translations = Translation_Braille.get_defaults()
|
||||
for braille_translation_row in braille_translations.iterrows():
|
||||
braille_translation_series = braille_translation_row[1]
|
||||
@@ -19,4 +19,6 @@ if __name__ == "__main__":
|
||||
|
||||
braille_translation = Translation_Braille(plaintext = plaintext, translation_proficiency_level = translation_proficiency_level, braille_text = braille_characters)
|
||||
braille_translation.print()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
test_get_all_characters()
|
||||
Reference in New Issue
Block a user