Yes, it should be possible to construct this type of co-occurrence matrix and then port it to a new environment. The procedure is a bit clumsy at the moment, but you can do something like this:
int windowSize = 2; // Adjust as necessary
GenericWordSpace gws = new GenericWordSpace(windowSize);
// Process your documents here
// gws.processDocument(...);
// Get the words in the semantic space whose vectors will form the rows of the
// matrix. (These are the words in the center of the sliding window)
List<String> wordsInSpace = new ArrayList<String>(gws.getWords());
List<DoubleVector> vectors = new ArrayList<DoubleVector>(wordsInSpace.size());
for (String word : wordsInSpace) {
vectors.add(Vectors.asDouble(gws.getVector(word)));
}
// Convert the vectors into a matrix
Matrix cooccurrenceMatrix = Matrices.asMatrix(vectors);
// TODO: save your matrix. Check out the MatrixIO class for easy to-do writing
// If you want to know the features associated with each column, you can do this
// too, but it's completely optional. These words are the words appearing in
// the sliding window as features (but not the target word).
//
// (NOTE: since the features are contiguous,
// you could do this code with a List<String> where the indices are the Map's
// keys, but I used a map to make it conceptually easier.)
Map<Integer,String> wordFeaturePerColumn = new HahsMap<Integer,String>();
for (int dimension = 0; dimension < gws.getVectorLength(); ++dimension) {
wordFeaturePerColumn.put(dimension, gws.getDimensionDescription(dimension));
}
I hope this helps and let me know if you have any questions.