SwiftSummarize

1.0.2

Create a summary from any string or text
StefKors/SwiftSummarize

What's New

1.0.2

2023-10-27T10:29:04Z

update SPI documentation

SwiftSummarize

SwiftSummarize is the easiest way to create a summary from a String. Internally it's a simple wrapper around CoreServices SKSummary

Before

Here's to the crazy ones. The misfits. The rebels. The troublemakers. The round pegs in the square holes. The ones who see things differently. They're not fond of rules. And they have no respect for the status quo. You can quote them, disagree with them, glorify or vilify them. About the only thing you can't do is ignore them. Because they change things. They push the human race forward. And while some may see them as the crazy ones, we see genius. Because the people who are crazy enough to think they can change the world, are the ones who do.

After

Because the people who are crazy enough to think they can change the world, are the ones who do

Install

Add this url to your dependencies:

https://github.com/StefKors/SwiftSummarize

Example

let input = """
Here's to the crazy ones. The misfits. The rebels. The troublemakers. The
round pegs in the square holes. The ones who see things differently. They're not
fond of rules. And they have no respect for the status quo. You can quote them,
disagree with them, glorify or vilify them. About the only thing you can't do is ignore
them. Because they change things. They push the human race forward. And while some
may see them as the crazy ones, we see genius. Because the people who are crazy
enough to think they can change the world, are the ones who do.  
"""

let summary = Summary(text, numberOfSentences: 1)

print(summary.output)
// Because the people who are crazy enough to think they can change the world, are the ones who do

Or use it directly on Strings with the extension

let input = """
Here's to the crazy ones. The misfits. The rebels. The troublemakers. The
round pegs in the square holes. The ones who see things differently. They're not
fond of rules. And they have no respect for the status quo. You can quote them,
disagree with them, glorify or vilify them. About the only thing you can't do is ignore
them. Because they change things. They push the human race forward. And while some
may see them as the crazy ones, we see genius. Because the people who are crazy
enough to think they can change the world, are the ones who do.  
"""

let output = input.summarize(numberOfSentences: 1)

print(output)
// Because the people who are crazy enough to think they can change the world, are the ones who do

A full SwiftUI code example can be found at /Example/ExampleSwiftUI.swift

preview

Description

  • Swift Tools 5.3.0
View More Packages from this Author

Dependencies

  • None
Last updated: Sun May 05 2024 01:26:51 GMT-0900 (Hawaii-Aleutian Daylight Time)