Logo

TKDocumentParser

TKDocumentParser 是一个 Swift 包,旨在简化从各种文档格式(包括 PDFDOCX)中提取纯文本的过程。 该包提供了一个简单的 API,用于处理不同类型的文档并检索其文本内容。

目录

演示

要查看 TKDocumentParser 的实际应用,请查看 TKDocumentParserDemo 仓库中包含的示例项目。 在 Xcode 中打开 TKDocumentParserDemo.xcodeproj 以运行演示应用程序并查看该包的工作方式。

安装

Swift Package Manager

要将 WingedSwift 添加到您的项目中,请将以下行添加到您的 Package.swift 文件中

dependencies: [
    .package(url: "https://github.com/toseefkhilji/TKDocumentParser.git", from: "1.0.0")
]

并将 TKDocumentParser 作为依赖项包含在您的目标中

targets: [
    .target(
        name: "YourTarget",
        dependencies: ["TKDocumentParser"]),
]

使用

TKDocumentParser 允许您从文档中获取纯文本。

基本示例

import TKDocumentParser

do {
        let url = // your local file path
        let text = try TKDocumentParser.parseText(from: url)
        print("extractedText: \(text)")
} catch {
        print(error.localizedDescription)    
}

文档

敬请期待!!!

贡献

欢迎贡献! 请按照以下步骤进行贡献

  1. Fork 仓库
  2. 创建一个新分支 (git checkout -b feature/new-feature)
  3. 提交您的更改 (git commit -am 'Add new feature')
  4. 推送到该分支 (git push origin feature/new-feature)
  5. 打开一个 Pull Request

许可

该项目根据 MIT 许可证获得许可。 有关更多详细信息,请参阅 LICENSE 文件。