All Projects → ezefranca → datamuse-swift

ezefranca / datamuse-swift

Licence: MIT license
A datamuse api swift wrapper without dependencies

Programming Languages

swift
15916 projects
objective c
16641 projects - #2 most used programming language
c
50402 projects - #5 most used programming language
shell
77523 projects
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to datamuse-swift

rhymer
R package for finding related words through the Datamuse API
Stars: ✭ 22 (+0%)
Mutual labels:  datamuse-api
leximaven
A command line tool for searching word-related APIs.
Stars: ✭ 20 (-9.09%)
Mutual labels:  datamuse

datamuse-swift

Platforms License Swift Package Manager CocoaPods compatible Carthage compatible Travis

logo

A datamuse api swift wrapper without dependencies

Requirements

  • iOS 9.3+ / Mac OS X 10.10+ / tvOS 9.0+ / watchOS 4.0+
  • Xcode 9.0+

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

To integrate datamuse-swift into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.3'
use_frameworks!

pod 'datamuse-swift', '~> 0.0.5'

Then, run the following command:

$ pod install

Carthage

Carthage is a decentralized dependency manager that automates the process of adding frameworks to your Cocoa application.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate datamuse-swift into your Xcode project using Carthage, specify it in your Cartfile:

github "datamuse-swift/datamuse-swift" ~> 0.0.1

Swift Package Manager

To use datamuse-swift as a Swift Package Manager package just add the following in your Package.swift file.

import PackageDescription

let package = Package(
    name: "Hellodatamuse-swift",
    dependencies: [
        .Package(url: "https://github.com/ezefranca/datamuse-swift.git", "0.0.1")
    ]
)

Manually

If you prefer not to use either of the aforementioned dependency managers, you can integrate datamuse-swift into your project manually. Just copy the Core folder to your project.

Usage

You just need a instace of DataMuseClient and can start yours calls.

let client = DataMuseClient()

All calls returns a [Words]. The Words are a struct with the score result of API and the word string:

public struct Words : Codable {
    public let word : String?
    public let score : Int?
}

List with all methods:

  • words with a meaning similar to ringing in the ears
public func wordMeaningSimilar(to: String, completion: @escaping ([Words]?, NSError?) -> Void)
  • words related to duck that start with the letter b
public func wordRelated(to: String, startedWith: String, completion: @escaping ([Words]?, NSError?) -> Void)
  • words related to spoon that end with the letter a
public func wordRelated(to: String, finishedWith: String, completion: @escaping ([Words]?, NSError?) -> Void)
  • words that sound like elefint
public func wordSoundsLike(to: String, completion: @escaping ([Words]?, NSError?) -> Void)
  • words that start with t, end in k, and have two letters in between
public func word(start: String, finish: String, numberofLettersBetween: Int, completion: @escaping ([Words]?, NSError?) -> Void)
  • words that are spelled similarly to coneticut
public func wordsSpelledSimilarly(to: String, completion: @escaping ([Words]?, NSError?) -> Void)
  • words that rhyme with forgetful
public func wordsThatRhyme(with: String, completion: @escaping ([Words]?, NSError?) -> Void)
  • words that rhyme with grape that are related to breakfast
public func wordsThatRhyme(with: String, related: String, completion: @escaping ([Words]?, NSError?) -> Void)
  • adjectives that are often used to describe ocean
public func adjectivesThatAreOften(to: String, completion: @escaping ([Words]?, NSError?) -> Void)
  • adjectives describing ocean sorted by how related they are to temperature
public func adjectivesThatDescribing(this: String, related: String, completion: @escaping ([Words]?, NSError?) -> Void)
  • nouns that are often described by the adjective yellow
public func nounsThatAreOftenDescribed(by: String, completion: @escaping ([Words]?, NSError?) -> Void)
  • words that often follow "drink" in a sentence, that start with the letter w
public func wordThatOften(follow: String, start: String, completion: @escaping ([Words]?, NSError?) -> Void)
  • words that are triggered by (strongly associated with) the word "cow"
public func wordsThatAreTriggered(by: String, completion: @escaping ([Words]?, NSError?) -> Void)
  • suggestions for the user if they have typed in rawand so far
public func suggestionsBased(into: String, completion: @escaping ([Words]?, NSError?) -> Void)

License

datamuse-swift is released under the MIT license. See LICENSE for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].