Rename KoralPipe-TermMapper to Koral-Mapper

Change-Id: Ib71a02b6640a9d93d81cb419d760f13a60ec5f58
diff --git a/cmd/termmapper/fuzz_test.go b/cmd/koralmapper/fuzz_test.go
similarity index 97%
rename from cmd/termmapper/fuzz_test.go
rename to cmd/koralmapper/fuzz_test.go
index e2ac02d..39f20c3 100644
--- a/cmd/termmapper/fuzz_test.go
+++ b/cmd/koralmapper/fuzz_test.go
@@ -11,8 +11,8 @@
 	"strings"
 	"testing"
 
-	tmconfig "github.com/KorAP/KoralPipe-TermMapper/config"
-	"github.com/KorAP/KoralPipe-TermMapper/mapper"
+	tmconfig "github.com/KorAP/Koral-Mapper/config"
+	"github.com/KorAP/Koral-Mapper/mapper"
 	"github.com/gofiber/fiber/v2"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
@@ -409,12 +409,12 @@
 }
 
 // # Run fuzzing for 1 minute
-// go test -fuzz=FuzzTransformEndpoint -fuzztime=1m ./cmd/termmapper
+// go test -fuzz=FuzzTransformEndpoint -fuzztime=1m ./cmd/koralmapper
 //
 // # Run fuzzing until a crash is found or Ctrl+C is pressed
-// go test -fuzz=FuzzTransformEndpoint ./cmd/termmapper
+// go test -fuzz=FuzzTransformEndpoint ./cmd/koralmapper
 //
 // # Run fuzzing with verbose output
-// go test -fuzz=FuzzTransformEndpoint -v ./cmd/termmapper
+// go test -fuzz=FuzzTransformEndpoint -v ./cmd/koralmapper
 //
 // go test -run=FuzzTransformEndpoint/testdata/fuzz/FuzzTransformEndpoint/$SEED
diff --git a/cmd/termmapper/main.go b/cmd/koralmapper/main.go
similarity index 98%
rename from cmd/termmapper/main.go
rename to cmd/koralmapper/main.go
index c1382cb..a998977 100644
--- a/cmd/termmapper/main.go
+++ b/cmd/koralmapper/main.go
@@ -11,8 +11,8 @@
 	"syscall"
 	"time"
 
-	"github.com/KorAP/KoralPipe-TermMapper/config"
-	"github.com/KorAP/KoralPipe-TermMapper/mapper"
+	"github.com/KorAP/Koral-Mapper/config"
+	"github.com/KorAP/Koral-Mapper/mapper"
 	"github.com/alecthomas/kong"
 	"github.com/gofiber/fiber/v2"
 	"github.com/rs/zerolog"
@@ -556,7 +556,7 @@
 
         function pluginit (p) {
           p.onMessage = function(msg) {
-            if (msg.key == 'termmapper') {
+            if (msg.key == 'koralmapper') {
               if (msg.value) {
                 qdata['job'] = 'add';
               }
diff --git a/cmd/termmapper/main_test.go b/cmd/koralmapper/main_test.go
similarity index 92%
rename from cmd/termmapper/main_test.go
rename to cmd/koralmapper/main_test.go
index 1447a15..fdd9612 100644
--- a/cmd/termmapper/main_test.go
+++ b/cmd/koralmapper/main_test.go
@@ -12,8 +12,8 @@
 	"strings"
 	"testing"
 
-	tmconfig "github.com/KorAP/KoralPipe-TermMapper/config"
-	"github.com/KorAP/KoralPipe-TermMapper/mapper"
+	tmconfig "github.com/KorAP/Koral-Mapper/config"
+	"github.com/KorAP/Koral-Mapper/mapper"
 	"github.com/gofiber/fiber/v2"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
@@ -485,7 +485,7 @@
 	assert.Equal(t, http.StatusOK, resp.StatusCode)
 	body, err = io.ReadAll(resp.Body)
 	require.NoError(t, err)
-	assert.Contains(t, string(body), "KoralPipe-TermMapper")
+	assert.Contains(t, string(body), "Koral-Mapper")
 
 }
 
@@ -569,7 +569,7 @@
 			assert.Contains(t, htmlContent, `data-server="`+tt.expectedServer+`"`)
 
 			// Ensure it's still a valid HTML page
-			assert.Contains(t, htmlContent, "KoralPipe-TermMapper")
+			assert.Contains(t, htmlContent, "Koral-Mapper")
 			assert.Contains(t, htmlContent, "<!DOCTYPE html>")
 		})
 	}
@@ -1120,18 +1120,18 @@
 	}{
 		{
 			name:               "Custom service URL",
-			customServiceURL:   "https://custom.example.com/plugin/termmapper",
-			expectedServiceURL: "https://custom.example.com/plugin/termmapper",
+			customServiceURL:   "https://custom.example.com/plugin/koralmapper",
+			expectedServiceURL: "https://custom.example.com/plugin/koralmapper",
 		},
 		{
 			name:               "Default service URL when not specified",
 			customServiceURL:   "", // Will use default
-			expectedServiceURL: "https://korap.ids-mannheim.de/plugin/termmapper",
+			expectedServiceURL: "https://korap.ids-mannheim.de/plugin/koralmapper",
 		},
 		{
 			name:               "Custom service URL with different path",
-			customServiceURL:   "https://my-server.org/api/v1/termmapper",
-			expectedServiceURL: "https://my-server.org/api/v1/termmapper",
+			customServiceURL:   "https://my-server.org/api/v1/koralmapper",
+			expectedServiceURL: "https://my-server.org/api/v1/koralmapper",
 		},
 	}
 
@@ -1171,7 +1171,7 @@
 			assert.Contains(t, htmlContent, "'service' : '"+expectedJSURL)
 
 			// Ensure it's still a valid HTML page
-			assert.Contains(t, htmlContent, "KoralPipe-TermMapper")
+			assert.Contains(t, htmlContent, "Koral-Mapper")
 			assert.Contains(t, htmlContent, "<!DOCTYPE html>")
 		})
 	}
@@ -1182,7 +1182,7 @@
 	configContent := `
 sdk: "https://custom.example.com/sdk.js"
 server: "https://custom.example.com/"
-serviceURL: "https://custom.example.com/api/termmapper"
+serviceURL: "https://custom.example.com/api/koralmapper"
 lists:
 - id: config-mapper
   mappings:
@@ -1202,7 +1202,7 @@
 	require.NoError(t, err)
 
 	// Verify that the service URL was loaded correctly
-	assert.Equal(t, "https://custom.example.com/api/termmapper", config.ServiceURL)
+	assert.Equal(t, "https://custom.example.com/api/koralmapper", config.ServiceURL)
 
 	// Verify other fields are also preserved
 	assert.Equal(t, "https://custom.example.com/sdk.js", config.SDK)
@@ -1225,7 +1225,7 @@
 	require.NoError(t, err)
 
 	htmlContent := string(body)
-	expectedJSURL := "https://custom.example.com/api/termmapper/config-mapper/query"
+	expectedJSURL := "https://custom.example.com/api/koralmapper/config-mapper/query"
 	assert.Contains(t, htmlContent, "'service' : '"+expectedJSURL)
 }
 
@@ -1244,7 +1244,7 @@
 	tmconfig.ApplyDefaults(config)
 
 	// Check that the default service URL was applied
-	assert.Equal(t, "https://korap.ids-mannheim.de/plugin/termmapper", config.ServiceURL)
+	assert.Equal(t, "https://korap.ids-mannheim.de/plugin/koralmapper", config.ServiceURL)
 
 	// Check that other defaults were also applied
 	assert.Equal(t, "https://korap.ids-mannheim.de/", config.Server)
@@ -1261,7 +1261,7 @@
 	require.NoError(t, err)
 
 	// Verify that the default service URL was applied since it's not in the example config
-	assert.Equal(t, "https://korap.ids-mannheim.de/plugin/termmapper", config.ServiceURL)
+	assert.Equal(t, "https://korap.ids-mannheim.de/plugin/koralmapper", config.ServiceURL)
 
 	// Verify other values from the example config are preserved
 	assert.Equal(t, "https://korap.ids-mannheim.de/js/korap-plugin-latest.js", config.SDK)
@@ -1288,7 +1288,7 @@
 	require.NoError(t, err)
 
 	htmlContent := string(body)
-	expectedJSURL := "https://korap.ids-mannheim.de/plugin/termmapper/main-config-mapper/query"
+	expectedJSURL := "https://korap.ids-mannheim.de/plugin/koralmapper/main-config-mapper/query"
 	assert.Contains(t, htmlContent, "'service' : '"+expectedJSURL)
 }
 
@@ -1301,27 +1301,27 @@
 	}{
 		{
 			name:       "Service URL without trailing slash",
-			serviceURL: "https://example.com/plugin/termmapper",
+			serviceURL: "https://example.com/plugin/koralmapper",
 			mapID:      "test-mapper",
-			expected:   "'service' : 'https://example.com/plugin/termmapper/test-mapper/query",
+			expected:   "'service' : 'https://example.com/plugin/koralmapper/test-mapper/query",
 		},
 		{
 			name:       "Service URL with trailing slash",
-			serviceURL: "https://example.com/plugin/termmapper/",
+			serviceURL: "https://example.com/plugin/koralmapper/",
 			mapID:      "test-mapper",
-			expected:   "'service' : 'https://example.com/plugin/termmapper/test-mapper/query",
+			expected:   "'service' : 'https://example.com/plugin/koralmapper/test-mapper/query",
 		},
 		{
 			name:       "Map ID with leading slash",
-			serviceURL: "https://example.com/plugin/termmapper",
+			serviceURL: "https://example.com/plugin/koralmapper",
 			mapID:      "/test-mapper",
-			expected:   "'service' : 'https://example.com/plugin/termmapper/test-mapper/query",
+			expected:   "'service' : 'https://example.com/plugin/koralmapper/test-mapper/query",
 		},
 		{
 			name:       "Both with slashes",
-			serviceURL: "https://example.com/plugin/termmapper/",
+			serviceURL: "https://example.com/plugin/koralmapper/",
 			mapID:      "/test-mapper",
-			expected:   "'service' : 'https://example.com/plugin/termmapper/test-mapper/query",
+			expected:   "'service' : 'https://example.com/plugin/koralmapper/test-mapper/query",
 		},
 		{
 			name:       "Complex map ID",
@@ -1376,7 +1376,7 @@
 
 	// Create mock config
 	mockConfig := &tmconfig.MappingConfig{
-		ServiceURL: "https://example.com/plugin/termmapper",
+		ServiceURL: "https://example.com/plugin/koralmapper",
 		Lists:      []tmconfig.MappingList{mappingList},
 	}
 
@@ -1398,43 +1398,43 @@
 		{
 			name:             "Default parameters (no query params)",
 			url:              "/test-mapper",
-			expectedQueryURL: "https://example.com/plugin/termmapper/test-mapper/query?dir=atob",
-			expectedRespURL:  "https://example.com/plugin/termmapper/test-mapper/response?dir=btoa",
+			expectedQueryURL: "https://example.com/plugin/koralmapper/test-mapper/query?dir=atob",
+			expectedRespURL:  "https://example.com/plugin/koralmapper/test-mapper/response?dir=btoa",
 			expectedStatus:   http.StatusOK,
 		},
 		{
 			name:             "Explicit dir=atob",
 			url:              "/test-mapper?dir=atob",
-			expectedQueryURL: "https://example.com/plugin/termmapper/test-mapper/query?dir=atob",
-			expectedRespURL:  "https://example.com/plugin/termmapper/test-mapper/response?dir=btoa",
+			expectedQueryURL: "https://example.com/plugin/koralmapper/test-mapper/query?dir=atob",
+			expectedRespURL:  "https://example.com/plugin/koralmapper/test-mapper/response?dir=btoa",
 			expectedStatus:   http.StatusOK,
 		},
 		{
 			name:             "Explicit dir=btoa",
 			url:              "/test-mapper?dir=btoa",
-			expectedQueryURL: "https://example.com/plugin/termmapper/test-mapper/query?dir=btoa",
-			expectedRespURL:  "https://example.com/plugin/termmapper/test-mapper/response?dir=atob",
+			expectedQueryURL: "https://example.com/plugin/koralmapper/test-mapper/query?dir=btoa",
+			expectedRespURL:  "https://example.com/plugin/koralmapper/test-mapper/response?dir=atob",
 			expectedStatus:   http.StatusOK,
 		},
 		{
 			name:             "With foundry parameters",
 			url:              "/test-mapper?dir=atob&foundryA=opennlp&foundryB=upos",
-			expectedQueryURL: "https://example.com/plugin/termmapper/test-mapper/query?dir=atob&foundryA=opennlp&foundryB=upos",
-			expectedRespURL:  "https://example.com/plugin/termmapper/test-mapper/response?dir=btoa&foundryA=opennlp&foundryB=upos",
+			expectedQueryURL: "https://example.com/plugin/koralmapper/test-mapper/query?dir=atob&foundryA=opennlp&foundryB=upos",
+			expectedRespURL:  "https://example.com/plugin/koralmapper/test-mapper/response?dir=btoa&foundryA=opennlp&foundryB=upos",
 			expectedStatus:   http.StatusOK,
 		},
 		{
 			name:             "With layer parameters",
 			url:              "/test-mapper?dir=btoa&layerA=pos&layerB=upos",
-			expectedQueryURL: "https://example.com/plugin/termmapper/test-mapper/query?dir=btoa&layerA=pos&layerB=upos",
-			expectedRespURL:  "https://example.com/plugin/termmapper/test-mapper/response?dir=atob&layerA=pos&layerB=upos",
+			expectedQueryURL: "https://example.com/plugin/koralmapper/test-mapper/query?dir=btoa&layerA=pos&layerB=upos",
+			expectedRespURL:  "https://example.com/plugin/koralmapper/test-mapper/response?dir=atob&layerA=pos&layerB=upos",
 			expectedStatus:   http.StatusOK,
 		},
 		{
 			name:             "All parameters",
 			url:              "/test-mapper?dir=atob&foundryA=opennlp&foundryB=upos&layerA=pos&layerB=upos",
-			expectedQueryURL: "https://example.com/plugin/termmapper/test-mapper/query?dir=atob&foundryA=opennlp&foundryB=upos&layerA=pos&layerB=upos",
-			expectedRespURL:  "https://example.com/plugin/termmapper/test-mapper/response?dir=btoa&foundryA=opennlp&foundryB=upos&layerA=pos&layerB=upos",
+			expectedQueryURL: "https://example.com/plugin/koralmapper/test-mapper/query?dir=atob&foundryA=opennlp&foundryB=upos&layerA=pos&layerB=upos",
+			expectedRespURL:  "https://example.com/plugin/koralmapper/test-mapper/response?dir=btoa&foundryA=opennlp&foundryB=upos&layerA=pos&layerB=upos",
 			expectedStatus:   http.StatusOK,
 		},
 		{
@@ -1483,7 +1483,7 @@
 				assert.Contains(t, htmlContent, "'service' : '"+tt.expectedRespURL+"'")
 
 				// Ensure it's still a valid HTML page
-				assert.Contains(t, htmlContent, "KoralPipe-TermMapper")
+				assert.Contains(t, htmlContent, "Koral-Mapper")
 				assert.Contains(t, htmlContent, "<!DOCTYPE html>")
 			}
 		})