-
Notifications
You must be signed in to change notification settings - Fork 332
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1545 from jplag/feature/emf-mode-fixes
Improvement of the EMF metamodel and model languages
- Loading branch information
Showing
28 changed files
with
452 additions
and
254 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
core/src/main/java/de/jplag/exceptions/ConfigurationException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
languages/emf-metamodel/src/main/java/de/jplag/emf/normalization/TokenOccurenceVector.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package de.jplag.emf.normalization; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* A vector for the occurrence frequency of different token types. The vector is padded with zeroes beyond its original | ||
* size. The vector content cannot be changed after its creation. | ||
*/ | ||
public class TokenOccurenceVector { | ||
private final List<Double> originalVector; | ||
|
||
/** | ||
* Creates a zero-padded token occurrence vector. | ||
* @param originalVector specifies the occurrence frequency values for the vector. | ||
*/ | ||
public TokenOccurenceVector(List<Double> originalVector) { | ||
this.originalVector = originalVector; | ||
} | ||
|
||
/** | ||
* Return a occurrence frequency value of the vector at the specified. | ||
* @param index is the specified index. | ||
* @return the occurrence frequency value or zero if the index is beyond the size of the vector. | ||
*/ | ||
public double get(int index) { | ||
if (index >= originalVector.size()) { | ||
return 0.0; | ||
} | ||
return originalVector.get(index); | ||
} | ||
|
||
/** | ||
* The original size of the vector, without padding. | ||
* @return the size. | ||
*/ | ||
public int size() { | ||
return originalVector.size(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.