Changeset 8760:4ac299021a8c in orange


Ignore:
Timestamp:
08/24/11 13:50:51 (3 years ago)
Author:
miha <miha.stajdohar@…>
Branch:
default
Convert:
962948f9f0f24a1bd7df1f9773d02df9cdd9879b
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • orange/OrangeWidgets/Visualize Qt/OWPubmedView.py

    r8759 r8760  
    164164        #self.titles = sorted([self.inside_view._network.node[n]['title'] for n in self.inside_view._network.nodes() if str_input in self.inside_view._network.node[n]['title'].encode().replace(' ', '').strip(' .').lower()]) # [(id,title)] 
    165165        str_input = str_input.strip(' .').lower().split(' ') 
    166         str_input = [w.strip('.,;:-/\\()') for w in str_input] 
    167         titles2 = [(n, str.lower(self.inside_view._network.node[n]['title'].encode().strip(' .')).split(' ')) for n in self.inside_view._network.nodes()] # [(id,title)] 
    168         titles2 = sorted(titles2, key = lambda x: sum(i.strip('.,;:-/\\()') in str_input for i in x[1]), reverse=True) 
     166        titles2 = [(n, str.lower(self.inside_view._network.node[n]['title'].encode('utf-8').strip(' .')).split(' ')) for n in self.inside_view._network.nodes()] # [(id,title)] 
     167        titles2 = sorted(titles2, key = lambda x: sum(i in str_input for i in x[1]), reverse=True) 
    169168        self.titles = [self.inside_view._network.node[x[0]]['title'] for x in titles2] 
    170169        self.ids = [x[0] for x in titles2] 
Note: See TracChangeset for help on using the changeset viewer.