code: private Matrix loadText(InputStream fileStream) throws IOException {
          Matrix matrix = null;
  
          BufferedReader br = 
                  new BufferedReader(new InputStreamReader(fileStream));
          String line = br.readLine();
          if (line == null)
              throw new IOException("Empty .sspace file");
              // Strip off the 4-byte (2 char) header
          String[] dimensions = line.split("\\s");
          int rows = Integer.parseInt(dimensions[0]);
          int columns = Integer.parseInt(dimensions[1]);
          int index = 0;
          
          // reusable array for writing rows into the matrix
          double[] row = new double[columns];
          
          matrix = new ArrayMatrix(rows, columns);
  
          while ((line = br.readLine()) != null) {
              if (index >= rows)
                  throw new IOException("More rows than specified");
              String[] termVectorPair = line.split("\\|");
              String[] values = termVectorPair[1].split("\\s");
              termToIndex.put(termVectorPair[0], index);
              if (values.length != columns) {
                  throw new IOException(
                              "improperly formated semantic space file");
              }
              for (int c = 0; c < columns; ++c) {
                  double d = Double.parseDouble(values[c]);
                  row[c] = d;
                  // matrix.set(index, c, d);
              }
              matrix.setRow(index, row);
              index++;
          }
          if (index != rows)
              throw new IOException(String.format(
                  "Expected %d rows; saw %d", rows, index));
          return matrix;    
      }
docs: Loads the {@link SemanticSpace} from the text formatted file, adding its
  words to {@link #termToIndex} and returning the {@code Matrix} containing
  the space's vectors.
  
  @param sspaceFile a file in {@link SSpaceFormat#TEXT text} format