File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -402,7 +402,8 @@ def buildImagePath(self, imageSrc):
402402
403403 def loadCustomSiteMapping (self ):
404404 # TODO
405- dataFile = FileHelper .loadResourceFile ("images/known-image-css.txt" )
405+ path = os .path .join ('images' , 'known-image-css.txt' )
406+ dataFile = FileHelper .loadResourceFile (path )
406407 lines = dataFile .splitlines ()
407408 for line in lines :
408409 domain , css = line .split ('^' )
Original file line number Diff line number Diff line change 2020See the License for the specific language governing permissions and
2121limitations under the License.
2222"""
23+ import os
2324import re
2425import string
2526from goose .utils import FileHelper
@@ -93,7 +94,7 @@ def __init__(self, language='en'):
9394 # TODO replace 'x' with class
9495 # to generate dynamic path for file to load
9596 if not language in self ._cached_stop_words :
96- path = 'text/ stopwords-%s.txt' % language
97+ path = os . path . join ( 'text' , ' stopwords-%s.txt' % language )
9798 self ._cached_stop_words [language ] = set (FileHelper .loadResourceFile (path ).splitlines ())
9899 self .STOP_WORDS = self ._cached_stop_words [language ]
99100
@@ -129,7 +130,7 @@ def __init__(self, language='zh'):
129130 # force zh languahe code
130131 language = 'zh'
131132 if not language in self ._cached_stop_words :
132- path = 'text/ stopwords-%s.txt' % language
133+ path = os . path . join ( 'text' , ' stopwords-%s.txt' % language )
133134 self ._cached_stop_words [language ] = set (FileHelper .loadResourceFile (path ).splitlines ())
134135 self .STOP_WORDS = self ._cached_stop_words [language ]
135136
You can’t perform that action at this time.
0 commit comments