Comments
-
Greg Hurrell
Ok, I've whipped up a quick test implementation of this and the results so far look good:
>> CommandT::Match.new('app/controllers/articles_controller.rb', 'artcon').score => 0.95 >> CommandT::Match.new('app/controllers/heartbeat_controller.rb', 'artcon').score => 0.809259259259259 >> CommandT::Match.new('app/controllers/heartbeat_controller.rb', 'art').score => 0.685185185185185 >> CommandT::Match.new('app/controllers/articles_controller.rb', 'art').score => 0.966666666666667 >> CommandT::Match.new('app/models/article.rb', 'art').score => 0.966666666666667
Still tweaking to do, and lots of testing, but it's at least a working demo of the "recurse to find best score" approach.
The score of the last two needs to be differentiated, I think, seeing as in the latter case you've entered a higher proportion of the string being searched, so it should be worth more I think.
-
Greg Hurrell
Perhaps this:
>> CommandT::Match.new('app/controllers/articles_controller.rb', 'art').score => 0.0763157894736842 >> CommandT::Match.new('app/models/article.rb', 'art').score => 0.138095238095238 >> CommandT::Match.new('app/models/article.rb', 'a').score => 0.0476190476190476 >> CommandT::Match.new('app/controllers/articles_controller.rb', 'a').score => 0.0263157894736842 >> CommandT::Match.new('app/controllers/articles_controller.rb', 'artcon').score => 0.15 >> CommandT::Match.new('app/controllers/heartbeat_controller.rb', 'artcon').score => 0.124501424501424 >> CommandT::Match.new('app/controllers/articles_controller.rb', 'articlescontroller').score => 0.46578947368421 >> CommandT::Match.new('app/controllers/articles_controller.rb', 'aca').score => 0.0736842105263158 >> CommandT::Match.new('app/controllers/heartbeat_controller.rb', 'aca').score => 0.0505494505494506
-
Greg Hurrell
Ok, this is pretty much done now. Performance degradation is noticeable on large trees (eg. my home directory; half a million files, but with match ceiling set to 10,000) but is still acceptable for smaller projects.
So optimization is definitely going to be required seeing as one of the selling points of the add-on is its performance, but, the quality of the ranking seems so much better in the hands-on testing that I've done that it seems like continuing down this path is an absolute no-brainer.
So going to close this ticket and put some optimization ideas in a separate one.
-
Greg Hurrell
Status changed:
- From: new
- To: closed
Add a comment
Comments are now closed for this issue.