DataImitator is a Clojure library designed to generate random words, phrases and ready-to-use data in multiple languages. It prepares data to meet your needs in many areas, from address information to finance, from person information to vehicle information.
- Multi-language support: Generate random words in Arabic, German, English, Spanish, French and Turkish .
- Random data: Generate random animal species, color, company data, datetime, finance, geometry, person, phone, shopping, unit, vehicle and word.
Add the following dependency to your project.clj
file:
[dataimitator "0.0.3"]
You can see some example uses below.
Generate a random conjunction in a specified language. Defaults to English if no language is specified.
(ns example.core
(:require [dataimitator.word.conjuction.core :refer [random-conjunction]]))
;; Generate a random English conjunction
(random-conjunction)
;; => "and"
;; Generate a random German conjunction
(random-conjunction :de)
;; => "aber"
Generate a random noun in a specified language. Defaults to English if no language is specified.
(ns example.core
(:require [dataimitator.word.noun.core :refer [random-noun]]))
;; Generate a random English noun
(random-noun)
;; => "car"
;; Generate a random Spanish noun
(random-noun :es)
;; => "coche"
Generate a random preposition in a specified language. Defaults to English if no language is specified.
(ns example.core
(:require [dataimitator.word.preposition.core :refer [random-preposition]]))
;; Generate a random English preposition
(random-preposition)
;; => "in"
;; Generate a random French preposition
(random-preposition :fr)
;; => "à"
Generate a random verb in a specified language. Defaults to English if no language is specified.
(ns example.core
(:require [dataimitator.word.verb.core :refer [random-verb]]))
;; Generate a random English verb
(random-verb)
;; => "run"
;; Generate a random Turkish verb
(random-verb :tr)
;; => "çalışmak"
Generate random lorem ipsum text with a specified number of words.
(ns example.core
(:require [dataimitator.word.lorem.core :refer [random-lorem-ipsum]]))
;; Generate random lorem ipsum text with 50 words
(random-lorem-ipsum 50)
;; => "Lorem ipsum dolor sit amet consectetur adipiscing elit..."
;; Generate random lorem ipsum text with 100 words
(random-lorem-ipsum 100)
;; => "Lorem ipsum dolor sit amet consectetur adipiscing elit..."
Licensed under the EPL.
Copyright © 2024