Files

21 lines
316 B
Go
Raw Permalink Normal View History

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
}