Changeset 5950
- Timestamp:
- 2003-11-24T14:29:15+13:00 (20 years ago)
- Location:
- trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/classifier
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/classifier/ClassifierInterface.java
r5798 r5950 17 17 * the "gsdl3" namespace... 18 18 */ 19 public voidclassifyDocument(DocumentID documentID, DocumentInterface document);19 public boolean classifyDocument(DocumentID documentID, DocumentInterface document); 20 20 21 public void start Pass(int pass);21 public void startClassifierPass(int pass); 22 22 23 23 public int getClassifierPasses(); 24 24 25 public void end Pass(int pass);25 public void endClassifierPass(int pass); 26 26 27 27 /** -
trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/classifier/ClassifierManager.java
r5798 r5950 1 1 package org.greenstone.gsdl3.gs3build.classifier; 2 3 import java.util.Iterator; 2 4 3 5 import org.greenstone.gsdl3.gs3build.doctypes.DocumentID; … … 36 38 } 37 39 38 /** 39 * Classify all the documents that the document list is able to provide... 40 */ 41 public void classifyDocuments() 42 { for (int i = 0; i < this.used; i ++) 43 { for (int p = 0; p < this.list[i].getClassifierPasses(); p ++) 44 { this.list[i].startPass(p); 45 for (int d = 0; d < this.documents.size(); d ++) 46 { this.list[i].classifyDocument(null, documents.getDocument(d)); 47 } 48 this.list[i].endPass(p); 49 } 50 this.list[i].completeClassification(); 51 } 40 /** 41 * Classify all the documents that the document list is able to provide... 42 */ 43 public void classifyDocuments() 44 { for (int i = 0; i < this.used; i ++) 45 { for (int p = 0; p < this.list[i].getClassifierPasses(); p ++) 46 { this.list[i].startClassifierPass(p); 47 48 Iterator iterator = this.documents.iterator(); 49 50 while (iterator.hasNext()) { 51 DocumentInterface document = (DocumentInterface) iterator.next(); 52 53 if (document.isIndexed()) { 54 if (!this.list[i].classifyDocument(document.getID(), document)) { 55 System.out.println("Ending document"); 56 } 57 } 52 58 } 59 this.list[i].endClassifierPass(p); 60 } 61 this.list[i].completeClassification(); 62 } 63 } 53 64 54 55 {while (size >= this.size)56 {ClassifierInterface newList [] = new ClassifierInterface[this.size*2];57 58 59 60 61 65 public void ensureSize(int size) 66 { while (size >= this.size) 67 { ClassifierInterface newList [] = new ClassifierInterface[this.size*2]; 68 this.size *= 2; 69 System.arraycopy(this.list, 0, newList, 0, this.size); 70 this.list = newList; 71 } 72 } 62 73 } -
trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/classifier/HierarchyClassifier.java
r5798 r5950 277 277 * @param <code>DocumentInterface</code> the document interface 278 278 */ 279 public voidclassifyDocument(DocumentID documentID, DocumentInterface document)279 public boolean classifyDocument(DocumentID documentID, DocumentInterface document) 280 280 { // the observer records the assignment of documents to classifications 281 281 HierarchyClassifierObserver classifyObserver = new HierarchyClassifierObserver(document); … … 298 298 this.hierarchy.getClassifications(documentID, values, classifyObserver); 299 299 } 300 return true; 300 301 } 301 302 … … 304 305 } 305 306 306 public void start Pass(int pass)307 public void startClassifierPass(int pass) 307 308 { 308 309 } 309 310 310 public void end Pass(int pass)311 public void endClassifierPass(int pass) 311 312 { 312 313 }
Note:
See TracChangeset
for help on using the changeset viewer.