Class VectorOperations
java.lang.Object
de.uni_mannheim.informatik.dws.melt.matching_ml.util.VectorOperations
Some utility provided in the form of static methods for vector operations.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionanalyzeVectorTextFile
(File textModelFile) Parses the concepts (not the vectors) from a text model file, i.e.private static boolean
Checks the provided file.readVectorFile
(File textModelFile) Read the provided text file.readVectorFile
(String textModelFilePath) Read the provided text file.readVectorFileAsFloat
(File textModelFile) Read the provided text file.readVectorFileAsFloat
(String textModelFilePath) Read the provided text file.
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
-
Constructor Details
-
VectorOperations
public VectorOperations()
-
-
Method Details
-
readVectorFile
Read the provided text file.- Parameters:
textModelFilePath
- Path to the text file. Each line represents a concept vector. All elements are space-separated. The first element is the concept string. Afterwards, the vector elements are named. The file must be UTF-8 encoded.- Returns:
- Parsed text model. Null in the case of an error.
-
readVectorFileAsFloat
Read the provided text file.- Parameters:
textModelFilePath
- Path to the text file. Each line represents a concept vector. All elements are space-separated. The first element is the concept string. Afterwards, the vector elements are named. The file must be UTF-8 encoded.- Returns:
- Parsed text model. Null in the case of an error.
-
readVectorFileAsFloat
Read the provided text file.- Parameters:
textModelFile
- The text file. Each line represents a concept vector. All elements are space-separated. The first element is the concept string. Afterwards, the vector elements are named. The file must be UTF-8 encoded.- Returns:
- Parsed text model. Null in the case of an error.
-
isFileOk
Checks the provided file.- Parameters:
textModelFile
- File to be checked.- Returns:
- True if ok, else false.
-
readVectorFile
Read the provided text file.- Parameters:
textModelFile
- The text file. Each line represents a concept vector. All elements are space-separated. The first element is the concept string. Afterwards, the vector elements are named. The file must be UTF-8 encoded.- Returns:
- Parsed text model. Null in the case of an error.
-
analyzeVectorTextFile
static org.javatuples.Triplet<Set<String>,Integer, analyzeVectorTextFileBoolean> (File textModelFile) Parses the concepts (not the vectors) from a text model file, i.e. a UTF-8 file where the concept is followed by its vector. One concept appears per line. Everything is space separated.- Parameters:
textModelFile
- The file the shall be parsed.- Returns:
- Triplet with:
[0] A set with the full vocabulary.
[1] Dimension
[2] True if dimension is consistent, else false.
-