Add readme

This commit is contained in:
2019-01-18 18:03:13 +00:00
parent 5e56ea491e
commit b72bf75ddd
11 changed files with 19 additions and 0 deletions

5
pymacro/macros Normal file
View File

@@ -0,0 +1,5 @@
.hc hydrocarbon
.h hydrogen
.c carbon
.o oxygen
:wink: 😉

5
pymacro/tests/macros Normal file
View File

@@ -0,0 +1,5 @@
.hc hydrocarbon
.h hydrogen
.c carbon
.o oxygen
:wink: 😉

View 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

View 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
View 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

View File

@@ -0,0 +1,2 @@
.chl chlorophyll
.ps photosynthesis

View File

@@ -0,0 +1 @@
.l louse lice

View 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
View 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'