Changeset 1635 for trunk/gsdl
- Timestamp:
- 2000-10-31T12:19:50+13:00 (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/phind/client/ResultBox.java
r1627 r1635 67 67 Panel label; 68 68 69 // The key identifying the phrase displayed, with its text and the 70 // collection from which it is drawn 71 String searchKey, searchPhrase; 72 String searchCollection; 69 // The key identifying the phrase displayed, with its text and the 70 // collection from which it is drawn 71 String searchKey, searchPhrase, searchCollection; 73 72 74 // The total frequency, expansion frequency, and document frequency75 // of the phrase76 int numberOfOccurances;73 // The total frequency, expansion frequency, and document frequency 74 // of the phrase 75 int numberOfOccurances; 77 76 int numberOfExpansions; 78 77 int numberOfDocuments; 79 78 80 // The number of phrases and documents retrieved, and the number of81 // times the user has requested more phrases or documents.82 int documentsRetrieved;83 int expansionsRetrieved;79 // The number of phrases and documents retrieved, and the number of 80 // times the user has requested more phrases or documents. 81 int documentsRetrieved; 82 int expansionsRetrieved; 84 83 int nextPhraseBlock; 85 84 int nextDocumentBlock; … … 318 317 // System.out.println( "addExpansionListTag: " + line); 319 318 320 String idStr = "", t fStr = "", efStr = "", dfStr = "";319 String idStr = "", text = "", tfStr = "", efStr = "", dfStr = ""; 321 320 int tf = 0, ef = 0, df = 0; 322 321 … … 351 350 } 352 351 352 // Read the text of the phrase 353 else if (line.startsWith("text")) { 354 line = line.substring(6); 355 nextSplit = line.indexOf((int) '"'); 356 if (nextSplit >= 1) { 357 text = line.substring(0, nextSplit); 358 line = line.substring(nextSplit + 1); 359 } else { 360 System.err.println("addExpansionListTag: error parsing: " + line); 361 } 362 } 363 353 364 // Read the expansion frequency 354 365 else if (line.startsWith("ef")) { … … 390 401 // Add the data to the ResultBox 391 402 searchKey = idStr; 403 searchPhrase = text; 392 404 numberOfOccurances = tf; 393 405 numberOfExpansions = ef; … … 410 422 // System.out.println( "addExpansionTag: " + line + " (" + expansionsRetrieved + ")"); 411 423 412 String numStr = "", idStr = "", tfStr = "", dfStr = "", body = ""; 424 String numStr = "", idStr = "", tfStr = "", dfStr = "", 425 prefix = "", body = "", suffix = ""; 426 427 body = searchPhrase; 413 428 414 429 // Break the tag down into its component parts … … 442 457 } 443 458 459 // Read the prefix of the phrase 460 else if (line.startsWith("prefix")) { 461 line = line.substring(8); 462 nextSplit = line.indexOf((int) '"'); 463 if (nextSplit >= 1) { 464 prefix = line.substring(0, nextSplit); 465 line = line.substring(nextSplit + 1); 466 } else { 467 System.err.println("ResultBox addExpansionTag: error parsing: " + line); 468 } 469 } 470 471 // Read the suffix of the phrase 472 else if (line.startsWith("suffix")) { 473 line = line.substring(8); 474 nextSplit = line.indexOf((int) '"'); 475 if (nextSplit >= 1) { 476 suffix = line.substring(0, nextSplit); 477 line = line.substring(nextSplit + 1); 478 } else { 479 System.err.println("ResultBox addExpansionTag: error parsing: " + line); 480 } 481 } 482 444 483 // Read the text of the phrase 445 else if (line.startsWith("text")) {446 447 448 449 450 451 452 453 454 }484 // else if (line.startsWith("text")) { 485 //line = line.substring(6); 486 //nextSplit = line.indexOf((int) '"'); 487 //if (nextSplit >= 1) { 488 // body = line.substring(0, nextSplit); 489 // line = line.substring(nextSplit + 1); 490 //} else { 491 // System.err.println("ResultBox addExpansionTag: error parsing: " + line); 492 //} 493 //} 455 494 456 495 // Read the frequency … … 490 529 491 530 // Create a new ResultItem and add it to the display 492 ResultItem ri = new ResultItem(idStr, tfStr, dfStr, "", body, "");531 ResultItem ri = new ResultItem(idStr, tfStr, dfStr, prefix, body, suffix); 493 532 494 533 if (c.addResultItem(ri)) {
Note:
See TracChangeset
for help on using the changeset viewer.