Text this: APIC: A method for automated pattern identification and classification