This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import syllapy | |
syllapy.count("hello") | |
# 2 | |
syllapy.count("world") | |
# 1 | |
syllapy.count("additional") | |
# 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from airflow.models import DAG | |
from airflow.operators.email_operator import EmailOperator | |
from airflow.operators.python_operator import PythonOperator | |
from datetime import datetime | |
from tempfile import NamedTemporaryFile | |
dag = DAG( | |
"email_example", | |
description="Sample Email Example with File attachments", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def _syllables(word): | |
syllable_count = 0 | |
vowels = 'aeiouy' | |
if word[0] in vowels: | |
syllable_count += 1 | |
for index in range(1, len(word)): | |
if word[index] in vowels and word[index - 1] not in vowels: | |
syllable_count += 1 | |
if word.endswith('e'): | |
syllable_count -= 1 |