crack521 / semanticvectors

Automatically exported from code.google.com/p/semanticvectors
Other
1 stars 0 forks source link

Search.java compile error and additional type constraints possible? #23

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Cmd-line compiling with Java 1.6, build 18
2.
3.

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?
Trying to stay current with latest check-ins.

Please provide any additional information below.

(I apologize in advance if my manual, low-level approach to compiling is
creating imaginary problems. My approach is necessary for other reasons.)

Search.java is referring to
"VectorSearcher.VectorSearcherConvolutionSim(..." which does not seem to
exist. Is Search.java relevant to the build? Any clarification would be
appreciated.

Also, I'm wondering is the committers would be interested in adding the
following type-safety constraints. I believe I "right-sized" the parametric
type in each case, but someone who knows the code better should verify. The
comment at the end of line spells out what changed. The line numbers
probably should be treated as approximations. Thank you.

pitt.search.semanticvectors.LuceneUtils.java:
   Line 66: private TreeSet <String> stopwords = null;   // Add <String>

pitt.search.semanticvectors.VectorStoreRAM.java:
   Line 83: public Enumeration <ObjectVector> getAllVectors() {  // Add
<ObjectVector>

pitt.search.semanticvectors.VectorStoreReaderLucene.java:
   Line 118: public Enumeration <ObjectVector> getAllVectors() { // Add
<ObjectVector>
   Line 182: public class VectorEnumeration implements Enumeration
<ObjectVector> { // Add <ObjectVector>

pitt.search.semanticvectors.TermTermVectorsFromLucene.java
   Line 96: public Enumeration <ObjectVector> getAllVectors() { // Add
<ObjectVector>

pitt.search.semanticvectors.TermVectorsFromLucene.java:
   Line 260: public Enumeration <ObjectVector> getAllVectors() { // Add
<ObjectVector>

pitt.search.semanticvectors.VectorStoreReaderText.java:
   Line 105: public Enumeration <ObjectStore> getAllVectors() { // Add
<ObjectVector>
   Line 180: public class VectorEnumerationText implements Enumeration
<ObjectVector> { // Add <ObjectVector>

pitt.search.semanticvectors.VectorStoreSparseRAM.java:
   Line 119: public class SparseVectorEnumeration implements Enumeration
<ObjectVector> { // Add <ObjectVector>

pitt.search.semanticvectors.DocVectors.java:
   Line 182: public Enumeration <ObjectVector> getAllVectors() { // Add
<ObjectVector>

pitt.search.semanticvectors.CompoundVectorBuilder.java:
   Line 283: ArrayList <float []> vectorList = new ArrayList <float[]> ();
// Add 2nd <float[]>

Original issue reported on code.google.com by classiclightphoto@gmail.com on 14 Apr 2010 at 5:35

GoogleCodeExporter commented 9 years ago
Search and VectorSearcher are definitely both needed, though if you're 
integrating
with SV you might connect to SV somewhere more basic than Search.java.

By basic compilation, do you mean a manual "javac *"? You're not using ant?

Yes please, we'd like the type-safety constraints.

Original comment by widd...@google.com on 14 Apr 2010 at 5:48

GoogleCodeExporter commented 9 years ago
Thanks for the VectorSearcher updates.

Also, here are some additional recommended type-safety addition requests:

pitt.search.semanticvectors.VectorSearcher.java:
   Line 395: this.disjunctSpace = new ArrayList <float []>();    // Added <float []>
   Line 443: this.disjunctVectors = new ArrayList <float []> (); // Added <float []>
   Line 574: public LinkedList <SearchResult> getNearestNeighbors (int numResults) {
// Added <SearchResult>
   Line 575: LinkedList<SearchResult> results = new LinkedList <SearchResult> (); //
Added 2nd <SearchResult>

Original comment by classiclightphoto@gmail.com on 15 Apr 2010 at 12:50

GoogleCodeExporter commented 9 years ago
Would you be willing to check in these type-safety additions directly? That 
would be 
great.

-Dominic

Original comment by widd...@google.com on 15 Apr 2010 at 2:18

GoogleCodeExporter commented 9 years ago
I think this should be done so I went ahead and did it, I hope I haven't 
stepped on any toes. See r420.

There is one missing change that I haven't committed:
src-ext/qut/beagle/BeagleNGramVectors.java:getAllVectors() deserves the same 
treatment on its return type. But I didn't do it because it is in src-ext, so 
presumably it comes from somewhere else.

Original comment by ThomasCR...@gmail.com on 6 Dec 2010 at 6:05

GoogleCodeExporter commented 9 years ago
As mentioned in Comment 4, I've added all of these except for 
BeagleNGramVectors.

Original comment by ThomasCR...@gmail.com on 8 Dec 2010 at 3:19

GoogleCodeExporter commented 9 years ago
Awesome, thanks for all you've been doing.

I wouldn't worry about treading on any toes in src-ext, please fix anything you 
see fit if you have the time. Much appreciated.

Original comment by widd...@google.com on 8 Dec 2010 at 3:38