Fix title parser
Change-Id: Iecacfeee8014b6748d422a6f11105a37bd53069f
diff --git a/parser/title_parser.go b/parser/title_parser.go
index b6c13bf..839ff5a 100644
--- a/parser/title_parser.go
+++ b/parser/title_parser.go
@@ -24,7 +24,7 @@
func NewTitleAttributeParser() *TitleAttributeParser {
// Single regex that captures: foundry/layer:key or foundry/layer:key[:=]value
// Groups: 1=foundry, 2=layer, 3=key, 4=value (optional)
- regex := regexp.MustCompile(`^([^/]+)/([^:]+):([^:=]+)(?:[:=](.+))?$`)
+ regex := regexp.MustCompile(`^([^/]+)/([^:]+):([^:]+)(?::(.+))?$`)
return &TitleAttributeParser{
regex: regex,
}
diff --git a/parser/title_parser_test.go b/parser/title_parser_test.go
index 3c82a59..326625f 100644
--- a/parser/title_parser_test.go
+++ b/parser/title_parser_test.go
@@ -30,7 +30,7 @@
},
{
name: "Parse title with key and value",
- input: "marmot/m:case=nom",
+ input: "marmot/m:case:nom",
expected: &TitleAttribute{
Foundry: "marmot",
Layer: "m",
@@ -52,7 +52,7 @@
},
{
name: "Parse title with equals separator for value",
- input: "marmot/m:degree=pos",
+ input: "marmot/m:degree:pos",
expected: &TitleAttribute{
Foundry: "marmot",
Layer: "m",
@@ -140,7 +140,7 @@
}{
{
name: "Parse multiple title attributes",
- input: []string{"corenlp/p:ART", "marmot/m:case=nom", "tt/l:die"},
+ input: []string{"corenlp/p:ART", "marmot/m:case:nom", "tt/l:die"},
expected: []ast.Node{
&ast.Term{
Foundry: "corenlp",