-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lexical matcher; parsing improvements
- Loading branch information
Showing
8 changed files
with
369 additions
and
111 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
33 changes: 33 additions & 0 deletions
33
klab.core.api/src/main/java/org/integratedmodelling/klab/api/lang/SemanticClause.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,33 @@ | ||
package org.integratedmodelling.klab.api.lang; | ||
|
||
import org.integratedmodelling.klab.api.knowledge.SemanticRole; | ||
import org.integratedmodelling.klab.api.knowledge.SemanticType; | ||
|
||
import java.util.EnumSet; | ||
import java.util.Set; | ||
|
||
public enum SemanticClause { | ||
|
||
OF(SemanticRole.INHERENT, "of", EnumSet.of(SemanticType.OBSERVABLE), EnumSet.of(SemanticType.COUNTABLE)), | ||
FOR(SemanticRole.GOAL, "for", EnumSet.of(SemanticType.OBSERVABLE), EnumSet.of(SemanticType.OBSERVABLE)), | ||
WITH(SemanticRole.COMPRESENT, "with", EnumSet.of(SemanticType.OBSERVABLE), EnumSet.of(SemanticType.COUNTABLE)), | ||
CAUSED_BY(SemanticRole.CAUSANT, "caused by", EnumSet.of(SemanticType.OBSERVABLE), EnumSet.of(SemanticType.OBSERVABLE)), | ||
ADJACENT_TO(SemanticRole.ADJACENT, "adjacent to", EnumSet.of(SemanticType.OBSERVABLE), EnumSet.of(SemanticType.COUNTABLE)), | ||
CAUSING(SemanticRole.CAUSED, "causing", EnumSet.of(SemanticType.PROCESS, SemanticType.EVENT), EnumSet.of(SemanticType.OBSERVABLE)), | ||
DURING(SemanticRole.COOCCURRENT, "during", EnumSet.of(SemanticType.OBSERVABLE), EnumSet.of(SemanticType.PROCESS, SemanticType.EVENT)), | ||
LINKING(SemanticRole.RELATIONSHIP_SOURCE, "linking", EnumSet.of(SemanticType.RELATIONSHIP), EnumSet.of(SemanticType.COUNTABLE)), | ||
TO(SemanticRole.RELATIONSHIP_TARGET, "to", EnumSet.of(SemanticType.RELATIONSHIP), EnumSet.of(SemanticType.COUNTABLE)); | ||
|
||
public String[] declaration; | ||
public SemanticRole role; | ||
public Set<SemanticType> applicable; | ||
public Set<SemanticType> argument; | ||
|
||
SemanticClause(SemanticRole role, String declaration, Set<SemanticType> applicable, Set<SemanticType> argument) { | ||
this.declaration = new String[] {declaration}; | ||
this.role = role; | ||
this.applicable = applicable; | ||
this.argument = argument; | ||
} | ||
|
||
} |
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
173 changes: 91 additions & 82 deletions
173
klab.core.api/src/main/java/org/integratedmodelling/klab/api/lang/UnarySemanticOperator.java
Large diffs are not rendered by default.
Oops, something went wrong.
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
Oops, something went wrong.