#Starting Python Web development in Mac OS X#
Objective: Getting started with Python Development Operating System: Mac OS X Python version installed: 3.5 (5th December 2015)
Downoad the lastest Python from https://www.python.org/downloads/
#Starting Python Web development in Mac OS X#
Objective: Getting started with Python Development Operating System: Mac OS X Python version installed: 3.5 (5th December 2015)
Downoad the lastest Python from https://www.python.org/downloads/
| var fetchedResultsProcessingOperations: [NSBlockOperation] = [] | |
| private func addFetchedResultsProcessingBlock(processingBlock:(Void)->Void) { | |
| fetchedResultsProcessingOperations.append(NSBlockOperation(block: processingBlock)) | |
| } | |
| func controller(controller: NSFetchedResultsController, didChangeObject anObject: AnyObject, atIndexPath indexPath: NSIndexPath?, forChangeType type: NSFetchedResultsChangeType, newIndexPath: NSIndexPath?) { | |
| switch type { | |
| case .Insert: |
| import string | |
| import nltk | |
| from nltk.tokenize import RegexpTokenizer | |
| from nltk.corpus import stopwords | |
| import re | |
| def preprocess(sentence): | |
| sentence = sentence.lower() | |
| tokenizer = RegexpTokenizer(r'\w+') | |
| tokens = tokenizer.tokenize(sentence) |