Skip to content

Commit dad1ea1

Browse files
committed
Fix WordNet term extraction to strip brackets for microservice
- Revert regex to strip square brackets when sending terms to WordNet - CNL file keeps brackets for proper syntax: 'Eukarya [Domain]' - WordNet service receives clean terms: 'Eukarya' - This allows WordNet to find definitions for the actual term names The batching system is already working correctly: - Frontend sends all terms in single batch request - WordNet microservice processes all terms in one call - Response contains array of results for all terms
1 parent 47d71ee commit dad1ea1

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

nodebook-base/frontend/src/services/wordnetService.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,9 @@ export class WordNetService {
137137

138138
// Check if this is a node definition (markdown heading)
139139
if (trimmedLine.startsWith('#')) {
140-
// Extract the node name (remove all # but preserve square brackets)
141-
// Updated regex to handle multiple # characters and preserve square brackets
142-
const nodeMatch = trimmedLine.match(/^#+\s*(.+?)\s*$/);
140+
// Extract the node name (remove all # and strip square brackets for WordNet)
141+
// Updated regex to handle multiple # characters and strip square brackets
142+
const nodeMatch = trimmedLine.match(/^#+\s*(.+?)(?:\s*\[.*?\])?\s*$/);
143143
if (nodeMatch) {
144144
const nodeName = nodeMatch[1].trim();
145145

0 commit comments

Comments
 (0)