Commit 7b1add2e authored by Han Zhang's avatar Han Zhang Committed by Julian Johannes Steinsberger-Dührßen
Browse files

Add two new tag schemas to data path tag schema

parent 2f620923
......@@ -27,8 +27,8 @@ import java.util.regex.Pattern;
public class DataPathSymbolCreator implements TagSymbolCreator {
private final String regexExpression = "\\s*\\{\\s*path\\s*=\\s*(.*)\\s*,\\s*type\\s*=\\s*(.*)\\s*\\}\\s*";
private final Pattern pattern = Pattern.compile(regexExpression, Pattern.MULTILINE);
protected final String regexExpression = "\\s*\\{\\s*path\\s*=\\s*(.*)\\s*,\\s*type\\s*=\\s*(.*)\\s*\\}\\s*";
protected final Pattern pattern = Pattern.compile(regexExpression, Pattern.MULTILINE);
@Override
public void create(ASTTaggingUnit unit, TaggingResolver tagging) {
......@@ -56,7 +56,7 @@ public class DataPathSymbolCreator implements TagSymbolCreator {
}
}
private void addTag(ASTTag tag, TaggingResolver tagging, String root, SymbolKind kind) {
protected void addTag(ASTTag tag, TaggingResolver tagging, String root, SymbolKind kind) {
tag.getTagElementList().stream()
.filter(tagElement -> tagElement.getName().equals("DataPath"))
.forEachOrdered(tagElement -> {
......@@ -75,7 +75,7 @@ public class DataPathSymbolCreator implements TagSymbolCreator {
});
}
private Matcher matchRegexPattern(String regex) {
protected Matcher matchRegexPattern(String regex) {
Matcher matcher = pattern.matcher(regex);
if (matcher.matches()) {
return matcher;
......@@ -92,7 +92,7 @@ public class DataPathSymbolCreator implements TagSymbolCreator {
}
private String dotJoin(String root, String name) {
protected String dotJoin(String root, String name) {
if (StringUtils.isEmpty(root)) {
return name;
}
......
......@@ -3,4 +3,14 @@ package dltag;
tagschema DeepLearningFilePathSchema {
tagtype DataPath for EMAComponentSymbol is { path = ${path:String}, type = ${type:String} };
// the name of training config data is optional,
// in this case, we'll try to load the file with the same name as the architecture
tagtype TrainingConfigDataPath for ComponentSymbol is
{ path = ${path:String} (, fileName = ${fileName:String})? };
tagtype TrainingConfigDataPath for ComponentInstanceSymbol is
{ path = ${path:String} (, fileName = ${fileName:String})? };
tagtype PreTrainedModelWeightsDataPath for ComponentSymbol is { path = ${path:String}, type = ${type:String} };
tagtype PreTrainedModelWeightsDataPath for ComponentInstanceSymbol is { path = ${path:String}, type = ${type:String} };
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment