Skip to content

Instantly share code, notes, and snippets.

@armsp
armsp / voice.py
Last active April 3, 2023 17:47
Identifying sentences with passive voices (english) using Spacy
import spacy
from spacy.matcher import Matcher
Active = "Harry ate six shrimp at dinner.\
Beautiful giraffes roam the savannah.\
Sue changed the flat tire.\
We are going to watch a movie tonight.\
I ran the obstacle course in record time.\
The crew paved the entire stretch of highway.\
Mom read the novel in one day.\
@cdunklau
cdunklau / extract_attachments.py
Last active August 27, 2021 22:14
A simple (and probably naive) script to extract attachments from .eml files for those of us who don't use software email clients.
#!/usr/bin/env python
"""
Extract all attachments from MS Outlook '.eml' file EML_FILE into
directory OUTPUT_DIR. If OUTPUT_DIR does not exist, it will be
created.
Usage: extract_attachments.py EML_FILE OUTPUT_DIR
"""
from __future__ import print_function
import sys