예제 #1
0
 def testUsername(self):
     self.testTweet = Tweet(
         text=
         '@uofCalgary RT @BlueLineTalent: Excellent opportunity in Austin, TX for @uofCalgary #Java Software 33445 Engineer (Jr/Mid Level) #Hibernate #CO #Jobs http://t.co/4l4Libv? @uofCalgary'
     )
     self.assertEqual(
         'RT: Excellent opportunity in Austin, TX for #Java Software 33445 Engineer (Jr/Mid Level) #Hibernate #CO #Jobs http://t.co/4l4Libv?',
         regexRemoval(self.testTweet, [TWITTER_USERNAME]))
예제 #2
0
 def testBrackets(self):
     self.testTweet = Tweet(
         text=
         'RT @BlueLineTalent: Excellent opportunity in [Austin, TX] for #Java Software 33445 Engineer (Jr/Mid Level) #Hibernate #CO #Jobs http://t.co/4l4Libv?'
     )
     self.assertEqual(
         'RT @BlueLineTalent: Excellent opportunity in Austin, TX for #Java Software 33445 Engineer Jr/Mid Level #Hibernate #CO #Jobs http://t.co/4l4Libv?',
         regexRemoval(self.testTweet, [TWITTER_BRACKETS]))
예제 #3
0
 def testZipcode(self):
     self.testTweet = Tweet(
         text=
         '55690 RT @BlueLineTalent: Excellent opportunity in Austin, TX for #Java Software 33445 Engineer (Jr/Mid Level) #Hibernate #CO #Jobs http://t.co/4l4Libv? 55342'
     )
     self.assertEqual(
         'RT @BlueLineTalent: Excellent opportunity in Austin, TX for #Java Software Engineer (Jr/Mid Level) #Hibernate #CO #Jobs http://t.co/4l4Libv?',
         regexRemoval(self.testTweet, [TWITTER_ZIPCODE]))
예제 #4
0
 def testMoney(self):
     self.testTweet = Tweet(
         text=
         '$20,000 RT @BlueLineTalent: Excellent opportunity in Austin, TX for $5000 #Java Software 33445 Engineer (Jr/Mid Level) #Hibernate #CO #Jobs http://t.co/4l4Libv? $62,50.00'
     )
     self.assertEqual(
         'RT @BlueLineTalent: Excellent opportunity in Austin, TX for #Java Software 33445 Engineer (Jr/Mid Level) #Hibernate #CO #Jobs http://t.co/4l4Libv?',
         regexRemoval(self.testTweet, [TWITTER_MONEY]))
예제 #5
0
 def testHyperlink(self):
     self.testTweet = Tweet(
         text=
         'http://t.co/4l4Libv? RT @BlueLineTalent: Excellent opportunity in Austin, TX for #Java Software Engineer (Jr/Mid Level) #Hibernate #CO #Jobs http://t.co/4l4Libv?'
     )
     self.assertEqual(
         'RT @BlueLineTalent: Excellent opportunity in Austin, TX for #Java Software Engineer (Jr/Mid Level) #Hibernate #CO #Jobs',
         regexRemoval(self.testTweet, [TWITTER_HYPERLINKS]))
예제 #6
0
 def testHashtags(self):
     self.testTweet = Tweet(
         text=
         '#Austin RT @BlueLineTalent: Excellent opportunity in Austin, TX for #Java Software Engineer (Jr/Mid Level) #Hibernate #CO #Jobs http://t.co/4l4Libv?'
     )
     self.assertEqual(
         'RT @BlueLineTalent: Excellent opportunity in Austin, TX for Software Engineer (Jr/Mid Level) http://t.co/4l4Libv?',
         regexRemoval(self.testTweet, [TWITTER_HASHTAGS]))
예제 #7
0
 def testStates(self):
     self.testTweet = Tweet(
         text=
         'Texas RT @BlueLineTalent: Excellent opportunity in Arkansas for #Java Software Engineer (Jr/Mid Level) #Hibernate #CO #Jobs http://t.co/4l4Libv? New Jersey'
     )
     self.assertEqual(
         'RT @BlueLineTalent: Excellent opportunity in  for #Java Software Engineer (Jr/Mid Level) #Hibernate #CO #Jobs http://t.co/4l4Libv?',
         regexRemoval(self.testTweet, [TWITTER_STATES]))
예제 #8
0
 def testUSCityState2Word(self):
     self.testTweet = Tweet(
         text=
         'San Antonio, TX RT @BlueLineTalent: Excellent opportunity in Austin, TX for #Java Software Engineer (Jr/Mid Level) #Hibernate #CO #Jobs http://t.co/4l4Libv? San Antonio, TX'
     )
     self.assertEqual(
         'RT @BlueLineTalent: Excellent opportunity for #Java Software Engineer (Jr/Mid Level) #Hibernate #CO #Jobs http://t.co/4l4Libv?',
         regexRemoval(self.testTweet, [TWITTER_US_STATES_2_WORD]))
예제 #9
0
 def testPunctuation(self):
     self.testTweet = Tweet(
         text=
         ':;,.?!|RT @BlueLineTalent: Excellent opportunity with start-up for #Java Software Engineer (Jr/Mid Level) #Hibernate #CO #Jobs http://t.co/4l4Libv?'
     )
     self.assertEqual(
         'RT @BlueLineTalent Excellent opportunity with startup for #Java Software Engineer (Jr/Mid Level) #Hibernate #CO #Jobs http//tco/',
         regexRemoval(self.testTweet, [TWITTER_PUNCTUATION]))
예제 #10
0
 def testDashSlash(self):
     self.testTweet = Tweet(
         text=
         '-RT @BlueLineTalent: Excellent opportunity in for #Java -Software Engineer - (Jr/Mid Level) \\#Hibernate #CO #Jobs htt//...'
     )
     self.assertEqual(
         'RT @BlueLineTalent: Excellent opportunity in for #Java Software Engineer  (JrMid Level) #Hibernate #CO #Jobs htt...',
         regexRemoval(self.testTweet, [TWITTER_DASH_SLASH]))
예제 #11
0
 def testCutoff(self):
     self.testTweet = Tweet(
         text=
         'RT @BlueLineTalent: Excellent opportunity in for #Java Software Engineer (Jr/Mid Level) #Hibernate #CO #Jobs htt...'
     )
     self.assertEqual(
         'RT @BlueLineTalent: Excellent opportunity in for #Java Software Engineer (Jr/Mid Level) #Hibernate #CO #Jobs',
         regexRemoval(self.testTweet, [TWITTER_CUTOFF]))
예제 #12
0
 def testPhraseRight(self):
     self.testTweet = Tweet(
         text=
         'Developer needed for a Sales Operations  #Seattle #Jobs http://t.co/yudRz40Uyq'
     )
     self.assertEqual("Developer", phraseRight(self.testTweet))
예제 #13
0
 def testPhraseLeft(self):
     self.testTweet = Tweet(
         text='@BlueLineTalent: is looking for a Sales Manager in Austin')
     self.assertEqual("Sales Manager in Austin", phraseLeft(self.testTweet))