@@ -176,11 +176,11 @@ protected void initializeHeavyItems() {
176
176
logger .info ("INDEX_DIR = " + indexDir );
177
177
178
178
try {
179
- this .entCalc = new EntropyCalc (SELECTED_REPOSITORY , indexDir , corpusDir );
179
+ // this.entCalc = new EntropyCalc(SELECTED_REPOSITORY, indexDir, corpusDir);
180
180
// loading the model
181
- if ( QDModelLoader . rfModelMap . isEmpty ()) {
182
- QDModelLoader .loadRFModels ();
183
- }
181
+ /*
182
+ * if ( QDModelLoader.rfModelMap.isEmpty()) { QDModelLoader. loadRFModels(); }
183
+ */
184
184
185
185
// load class rank keys
186
186
if (keyFileMap .isEmpty ()) {
@@ -481,7 +481,6 @@ public void run() {
481
481
482
482
// populate and highlight
483
483
populateResultsToTable (entities );
484
-
485
484
}
486
485
});
487
486
}
@@ -511,21 +510,31 @@ public void widgetSelected(SelectionEvent e) {
511
510
IEclipsePreferences store = InstanceScope .INSTANCE .getNode ("ca.usask.cs.srlab.bugdoctor" );
512
511
int bugID = store .getInt ("SELECTED_BUGID" , 0 );
513
512
String repoName = store .get ("SELECTED_REPOSITORY" , "eclipse.jdt.debug" );
513
+ qd .config .StaticData .HOME_DIR = StaticData .HOME_DIR ;
514
514
String indexFolder = store .get ("INDEX_DIR" , "default_index" );
515
515
String repoSourceFolder = store .get ("REPOSITORY_SRC_DIRECTORY" , "default_repo_src" );
516
+
516
517
String searchQuery = input .getText ();
517
- CodeRankQueryExpansionProvider crProvider = new CodeRankQueryExpansionProvider (repoName , bugID ,
518
- searchQuery , indexFolder , repoSourceFolder , entCalc );
519
- String bestQuery = crProvider .getExtendedQuery (StaticData .BR_NL_QR_LEN );
518
+ String bestQuery = new String ();
519
+
520
+ if (acerButton .getSelection () && acerButton .getEnabled ()) {
521
+ CodeRankQueryExpansionProvider crProvider = new CodeRankQueryExpansionProvider (repoName , bugID ,
522
+ searchQuery , indexFolder , repoSourceFolder );
523
+ bestQuery = crProvider .getExtendedQuery (StaticData .BR_NL_QR_LEN );
524
+ } else if (bladerButton .getSelection () && bladerButton .getEnabled ()) {
525
+ // getting the blader query
526
+ }
520
527
521
528
ArrayList <Result > extendedKeywords = new ArrayList <>();
529
+ // adding the title result
522
530
String normalizedTitle = new blizzard .text .normalizer .TextNormalizer (searchQuery ).normalizeSimple ();
523
531
Result titleResult = new Result ();
524
532
titleResult .token = normalizedTitle ;
525
533
titleResult .totalScore = 1.00 ;
526
- // extendedKeywords.add(titleResult);
527
- ArrayList <String > keywords = qd .utility .MiscUtility .str2List (bestQuery );
534
+ extendedKeywords .add (titleResult );
528
535
536
+ // adding the keywords
537
+ ArrayList <String > keywords = qd .utility .MiscUtility .str2List (bestQuery );
529
538
for (int index = 1 ; index < keywords .size (); index ++) {
530
539
String keyword = keywords .get (index );
531
540
double relevance = 1 - (double ) index / keywords .size ();
@@ -541,7 +550,6 @@ public void widgetSelected(SelectionEvent e) {
541
550
@ Override
542
551
public void widgetDefaultSelected (SelectionEvent e ) {
543
552
// TODO Auto-generated method stub
544
-
545
553
}
546
554
});
547
555
@@ -653,10 +661,11 @@ public void run() {
653
661
String bugDoctorQuery = new String ();
654
662
655
663
ArrayList <Result > suggestedKeywords = new ArrayList <Result >();
656
- int startIndex = 0 ;
664
+ int startIndex = 1 ;
657
665
658
666
// concepts mode of BugDoctor
659
667
if (strictButton .getSelection () && strictButton .getEnabled ()) {
668
+ qd .config .StaticData .HOME_DIR = store .get ("HOME_DIR" , "default_home" );
660
669
strict .ca .usask .cs .srlab .strict .config .StaticData .STOPWORD_DIR = store .get ("STOPWORD_DIR" ,
661
670
"default_stopword" );
662
671
strict .ca .usask .cs .srlab .strict .config .StaticData .SAMURAI_DIR = store .get ("SAMURAI_DIR" ,
@@ -666,7 +675,7 @@ public void run() {
666
675
667
676
SearchTermProvider stProvider = new SearchTermProvider (SELECTED_REPOSITORY , bugID , title ,
668
677
bugReport );
669
- String bestQuery = stProvider .deliverBestQuery (entCalc );
678
+ String bestQuery = stProvider .deliverBestQuery ();
670
679
System .out .println (bestQuery );
671
680
bugDoctorQuery = bestQuery ;
672
681
}
0 commit comments