GitXplorerGitXplorer
B

Analysis

public
122 stars
3 forks
9 issues

Commits

List of commits on branch main.
Unverified
196a4d52d23e9a2922b1e050e4d431610c0b3e0b

Update Gemfile.lock

BBasThomas committed 4 months ago
Verified
73ab6c24eaa6cef654e424f308c09188eca08fd3

Bump rexml from 3.2.5 to 3.2.8 (#29)

ddependabot[bot] committed 8 months ago
Verified
fc1cfd32621307403706a77350a1911f90601ec5

Bump activesupport from 6.1.7.3 to 6.1.7.6 (#28)

ddependabot[bot] committed a year ago
Verified
c686069910d11b9e5169437188caf8312ea24271

Bump activesupport from 6.1.7.1 to 6.1.7.3 (#26)

ddependabot[bot] committed 2 years ago
Verified
029eee845e3b680ad5afbd7949b2ec8abf2b34a6

Bump activesupport from 6.1.5 to 6.1.7.1 (#25)

ddependabot[bot] committed 2 years ago
Unverified
ad2e2b03ca6c19daf09f8c3cf5a5da2730738528

Update Gemfile.lock

BBasThomas committed 3 years ago

README

The README file for this repository.

Travis status

Analysis

Analysis is a tool that helps you extract useful information from strings. It calculates the amount of sentences, words, characters, occurrence of words and characters, and more.

Installation

Analysis is available via CocoaPods.

pod 'Analysis'

Then run pod install.

Sample Project

There's a sample project in the Example directory. To use it, run pod install to download the required libraries.

Usage

Analysing a string is very straightforward. You can use any of these two ways to instantiate an Analysis:

import Analysis

let analysis = Analysis(of: "You are awesome, you!")

or

import Analysis

let analysis = "You are awesome, you!".analysed()

After that, you can get the information you need.

analysis.sentenceCount() // 1
analysis.wordCount(unique: true) // 4
analysis.characterCount(includingSpaces: false) // 18
analysis.wordOccurrences(caseSensitive: true) // ["You": 1, "are": 1, "awesome", 1, "you": 1]
analysis.wordOccurrences(caseSensitive: false) // ["you": 2, "are": 1, "awesome", 1]
analysis.frequency(of: "you", caseSensitive: false) // 50.0%
analysis.averageCharacters(per: .word) // 5.33

analysis.syllableCount() // 5
analysis.wordSyllables() // ["you": 1, "are": 1, "awesome": 2]
analysis.fleschReadingEase() // 97.025
analysis.fleschKincaidGradeLevel() // 0.72

You can also easily sort your occurences via an enhanced sorting method on Dictionary.

analysis
  .wordOccurrences(caseSensitive: false)
  .sorted(by: .key, order: .ascending) // [("are", 1), ("awesome", 1), ("you", 2)]

Contributing

Want to contribute to this project? Great! There's some things that still need work, but definitely also let me know when you encounter any issues, spot a bug, or have a feature request!

Check out the issues for some tasks to get started with. Or, write tests. We can use as many as you can think of.

License

Analysis is released under an MIT license. See License for more information.