Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- article = """
- Senator johnson was caught stealing a smartphone on election night.
- witnesses say that he allegedly took the smartphone from a kindly old
- lady while she was washing her electric car. republican and democrat
- congressional leaders have vowed to hold hearings. Senator johnson could
- not be reached for comment.
- """
- function translateNews(article::String, boringWords::Array, funWords::Array)
- article = lowercase(article)
- for i in 1:size(boringWords, 1)
- article = replace(article, boringWords[i], funWords[i])
- end
- return article
- end
- println(translateNews(article,boring_news,xkcd))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement