X-Git-Url: http://secure.phpeclipse.com diff --git a/net.sourceforge.phpeclipse.tests/src/net/sourceforge/phpdt/core/tests/lucene/PHPWriter.java b/net.sourceforge.phpeclipse.tests/src/net/sourceforge/phpdt/core/tests/lucene/PHPWriter.java deleted file mode 100644 index d370d3b..0000000 --- a/net.sourceforge.phpeclipse.tests/src/net/sourceforge/phpdt/core/tests/lucene/PHPWriter.java +++ /dev/null @@ -1,97 +0,0 @@ -package net.sourceforge.phpdt.core.tests.lucene; - -import java.io.IOException; - -import net.sourceforge.phpeclipse.internal.compiler.ast.AbstractMethodDeclaration; -import net.sourceforge.phpeclipse.internal.compiler.ast.CompilationUnitDeclaration; -import net.sourceforge.phpeclipse.internal.compiler.ast.ImportReference; -import net.sourceforge.phpeclipse.internal.compiler.ast.MethodDeclaration; -import net.sourceforge.phpeclipse.internal.compiler.ast.TypeDeclaration; - -import org.apache.lucene.analysis.standard.StandardAnalyzer; -import org.apache.lucene.document.Document; -import org.apache.lucene.document.Field; -import org.apache.lucene.index.IndexWriter; -import org.eclipse.core.resources.IFile; - -public class PHPWriter { - private IndexWriter fWriter = null; - -public PHPWriter(String indexPath, boolean create) throws IOException { - // Make a lucene writer and create new Lucene index with arg3 = true - fWriter = new IndexWriter(indexPath, new StandardAnalyzer(), create); - } - - public boolean addDocument(CompilationUnitDeclaration computedUnit, IFile file) { - Document doc = new Document(); - try { - if (file != null) { - doc.add(Field.Keyword("filename", file.getName())); - doc.add(Field.Keyword("path", file.getProjectRelativePath().toString())); - } - if (computedUnit.imports != null) { - ImportReference imp; - for (int i=0; i