File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 11import sys
22from os import walk
33from spellCheck import *
4+ import ntpath
5+ from os .path import expanduser
6+ home = expanduser ("~" )
47
58keywords = [f .rstrip ().lower () for f in open ('keywords.txt' , 'r' )]
69print keywords
@@ -15,16 +18,19 @@ def printDetails(filePath):
1518 for line in open (filePath , 'r' ):
1619 lineNo += 1
1720 lines = re .findall ('[a-z]+' , line .lower ())
21+ cmt = ''
22+ if line .startswith ('//' ): cmt = ' //-- cmt'
1823 for word in lines :
1924 word = word .rstrip ().lower ()
2025 if word in keywords : continue
2126 a = correct (word )
2227 if a != word :
23- wordChange = 'Line: ' + str (lineNo )+ ' => ' + word + ' != ' + a + '\n '
28+ wordChange = 'Line: ' + str (lineNo )+ ' => ' + word + ' != ' + a + cmt + '\n '
2429 val += wordChange
2530 print wordChange
2631 val += "\n \n ----------------------------------------------------------\n \n "
27- file_op = open (filePath + ".gds.txt" , "w" )
32+ head , tail = ntpath .split (filePath )
33+ file_op = open (home + '/Desktop/swift-typo/' + tail + ".gds.txt" , "w" )
2834 file_op .write (val )
2935 file_op .close ()
3036
You can’t perform that action at this time.
0 commit comments