-
Notifications
You must be signed in to change notification settings - Fork 0
Introduce Parser interface. #13
Copy link
Copy link
Open
0 / 20 of 2 issues completedLabels
coreCore feature must be implmentedCore feature must be implmented
Milestone
Description
Description
Introduce a Parser interface to support different file types such as .txt, .html, .pdf, etc. This makes the engine extensible and ready for multi-format parsing.
Why
- Currently, the engine only supports parsing plain
.txtfiles. - Introducing a common interface allows us to plug in support for other formats cleanly.
What to Add
- Define a
Parserinterface with a method likeParse(path string) ([]string, error)that extracts indexable results. - Refactor the existing
.txtparsing logic to implement this interface. - Update the engine to use the interface instead of hardcoding
.txtlogic. - Introduce a parser factory that select parser based on file extension or file headers.
Example
type Parser interface {
Parse(path string) ([]string, error)
}
// Usage
parser := parserFactory.GetParser("file.html")
words, err := parser.Parse("file.html")Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
coreCore feature must be implmentedCore feature must be implmented