21 lines
316 B
Go
21 lines
316 B
Go
package ingestion
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"github.com/nguyenthenguyen/docx"
|
|
)
|
|
|
|
func ParseDOCX(path string) (string, error) {
|
|
reader, err := docx.ReadDocxFile(path)
|
|
if err != nil {
|
|
return "", err
|
|
}
|
|
defer reader.Close()
|
|
|
|
doc := reader.Editable()
|
|
text := doc.GetContent()
|
|
|
|
return strings.TrimSpace(text), nil
|
|
}
|