mirror of
https://github.com/alvierahman90/otfmacros.git
synced 2025-10-13 16:04:30 +00:00
Add readme
This commit is contained in:
5
pymacro/macros
Normal file
5
pymacro/macros
Normal file
@@ -0,0 +1,5 @@
|
||||
.hc hydrocarbon
|
||||
.h hydrogen
|
||||
.c carbon
|
||||
.o oxygen
|
||||
:wink: 😉
|
5
pymacro/tests/macros
Normal file
5
pymacro/tests/macros
Normal file
@@ -0,0 +1,5 @@
|
||||
.hc hydrocarbon
|
||||
.h hydrogen
|
||||
.c carbon
|
||||
.o oxygen
|
||||
:wink: 😉
|
12
pymacro/tests/test_actual_output
Normal file
12
pymacro/tests/test_actual_output
Normal file
@@ -0,0 +1,12 @@
|
||||
Hydrocarbons are composed of exclusively hydrogen and carbon.
|
||||
|
||||
Chlorophyll is the site of photosynthesis.
|
||||
|
||||
😉
|
||||
|
||||
1 hydrocarbon 2 hydrocarbons
|
||||
1 dress 2 dresses
|
||||
1 story 2 stories
|
||||
1 hero 2 heroes
|
||||
1 leaf 2 leaves
|
||||
1 man 2 men
|
12
pymacro/tests/test_expected_output
Normal file
12
pymacro/tests/test_expected_output
Normal file
@@ -0,0 +1,12 @@
|
||||
Hydrocarbons are composed of exclusively hydrogen and carbon.
|
||||
|
||||
Chlorophyll is the site of photosynthesis.
|
||||
|
||||
😉
|
||||
|
||||
1 hydrocarbon 2 hydrocarbons
|
||||
1 dress 2 dresses
|
||||
1 story 2 stories
|
||||
1 hero 2 heroes
|
||||
1 leaf 2 leaves
|
||||
1 man 2 men
|
12
pymacro/tests/test_input
Normal file
12
pymacro/tests/test_input
Normal file
@@ -0,0 +1,12 @@
|
||||
.Hcs are composed of exclusively .h and .c.
|
||||
|
||||
.Chl is the site of .ps.
|
||||
|
||||
:wink:
|
||||
|
||||
1 .hc 2 .hcs
|
||||
1 .d 2 .ds
|
||||
1 .s 2 .ss
|
||||
1 .he 2 .hes
|
||||
1 .l 2 .ls
|
||||
1 .m 2 .ms
|
2
pymacro/tests/test_macros_biology
Normal file
2
pymacro/tests/test_macros_biology
Normal file
@@ -0,0 +1,2 @@
|
||||
.chl chlorophyll
|
||||
.ps photosynthesis
|
1
pymacro/tests/test_macros_custom_plurals
Normal file
1
pymacro/tests/test_macros_custom_plurals
Normal file
@@ -0,0 +1 @@
|
||||
.l louse lice
|
6
pymacro/tests/test_macros_plural
Normal file
6
pymacro/tests/test_macros_plural
Normal file
@@ -0,0 +1,6 @@
|
||||
.hc hydrocarbon
|
||||
.d dress
|
||||
.s story
|
||||
.he hero
|
||||
.l leaf
|
||||
.m man men
|
14
pymacro/word_utils.py
Normal file
14
pymacro/word_utils.py
Normal file
@@ -0,0 +1,14 @@
|
||||
def is_consonant(letter):
|
||||
if not isinstance(letter, str):
|
||||
raise ValueError("Argument 'letter' must be type str")
|
||||
if len(letter) != 1:
|
||||
raise ValueError("Argument 'letter' must be 1 long")
|
||||
return not is_vowel(letter)
|
||||
|
||||
def is_vowel(letter):
|
||||
if not isinstance(letter, str):
|
||||
raise ValueError("Argument 'letter' must be type str")
|
||||
if len(letter) != 1:
|
||||
raise ValueError("Argument 'letter' must be 1 long")
|
||||
return letter in 'aeiou'
|
||||
|
Reference in New Issue
Block a user