User Tools

Site Tools


public:t-malv-15-3:2

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

public:t-malv-15-3:2 [2015/09/01 23:29]
orvark Solutions added
public:t-malv-15-3:2 [2015/09/02 23:33] (current)
orvark [2. Regular Expressions to match words]
Line 78: Line 78:
 </code> </code>
  
-Now lets use re.match to examine the words in the list of tokens in part 1.+Now lets use ''re.match'' to examine the words in the list of tokens in part 1.
  
 We can for example use it to try find all mentions of years in the text. We can for example use it to try find all mentions of years in the text.
Line 183: Line 183:
     bigram_fd = nltk.FreqDist()     bigram_fd = nltk.FreqDist()
  
-    bigram_fd['. '+token_list[0]] = 1  # first bigram ('.' padding + word)+    bigram_fd['. '+token_list[0]] = 1  # first bigram ('.' padding + first word)
  
     for i in range(1, len(token_list)):     for i in range(1, len(token_list)):
/var/www/ailab/WWW/wiki/data/attic/public/t-malv-15-3/2.1441150151.txt.gz ยท Last modified: 2015/09/01 23:29 by orvark