What is Crypto Cars Worl (CARS) | What is CARS token

In this article, we'll discuss information about the Crypto Cars Worl project and CARS token.

Crypto Cars World is a video game based on NFT blockchain technology, inspired by Need for Speed or Gran Turismo, in which players compete in races within circuits where the fastest is the winner.

You can choose to be a mechanic, a racer or BOTH!!!

All users, the first time they register, will receive a garage and a completely free vehicle to try the Crypto Cars World experience.

This free vehicle will be limited to 30 races. Once the limit is reached, you will have to buy a new vehicle.

The minimum amount of CARS that you must enter into the game is 5 CARS.

In order to withdraw the RC winnings to be able to exchange them for CARS, you must have an NFT car.

Token

Crypto Cars World will have 2 coins. One within the blockchain with a variable value and an internal one that has no value and cannot be purchased outside of the game.

CARS

CARS is the acronym for the Crypto Cars World token. You can earn it by farming or racing in competitive mode.

Each user has a free garage with capacity for two cars. You are also provided with a basic car to enter the racing world. You can farm in your free garage, but they won't be able to take care of your cars. The player must buy one of the garages available in the marketplace so that the vehicles take care of him.

To get CARS you can buy them at Pancakeswap or by exchanging RC for CARS within the game.

Official contract: 0x1228Fb5eF4C98CaBd696Ba1BD4819e050389D21A

Internal currency

Race (RC) is the internal currency and is used to buy items within the game. Buy gasoline, either cans / pumps, tool boxes or tickets.

1 CARS = 100 RC 

125 RC = 1 CARS

You can earn it by farming or racing in competitive mode.

CARS supply management

TokensDistributionPercent
Max. Supply 325.000.000100%
Team and Marketing
48.750.000,00Team15%
16.250.000,00Marketing5%
Pre-sales Token
2.500.0000,76%
Ecosystem
19.500.000,006%
Reserve(Staking)
32.500.000,0010%
Rewards in game
205.500.000,0063,23%

This is the total token distribution for the game.

Team and Marketing: The first day 10% of the total received by the team is released. Each week 3% will be released until reaching 100% of the token released for the team.

*15 days LOCKED after presale* (requested by our community)

*THE TEAM HAS SIGNED a LEGAL CONTRACT, NO ONE CAN SELL AND DESTABILIZE THE TOKEN PRICE.*

Token pre-sales: 6 million tokens are reserved for token pre-sales before being listed on the exchange.

Ecosystem: It is reserved for the development of the video game. Reserve: It is reserved to give rewards to users who do staking.

Game rewards: It is the main part, which is the one obtained by changing the RC earned by CARS.

RoadMap 

2021

Q3

Official Name "Crypto Cars World" ✔️

Creation of WhitePaper y RoadMap ✔️

Official launch of the website. ✔️

First presale of vehicles. 08/31/2021 ✔️

Second vehicle presale 05/09/2021✔️

Third vehicle pre-sale 06/09/2021✔️

Fourth vehicle pre-sale (Soon) (In CARS)

Special presale of donors 24H (In BNB)

Token creation : 0x1228Fb5eF4C98CaBd696Ba1BD4819e050389D21A ✔️

Token audit ✔️

Airdrop

First presale of the CARS 2,5M token ✔️

Listing of the token in Pancake Swap and other exchanges ✔️

Marketplace aperture

Concessionaire aperture

Farming aperture (Alpha private)

Listing on Twitch ✔️

Q4

Opening of farming mode (Alpha + Beta Public)

Car rental system (Scholarships)

Token Burning and Staking

Game mechanics with keyboard, controller and steering wheel

3D PVE game launch

First season championship

Launch of special first season packs (Christmas, Halloween ...)

PVP launch

PVP launch STEAM

2022

Q1

Open world racing

Game modes on request of users

Community created circuits

​How and Where to Buy CARS token?

CARS token is now live on the Binance mainnet. The token address for CARS is 0x1228Fb5eF4C98CaBd696Ba1BD4819e050389D21A. Be cautious not to purchase any other token with a smart contract different from this one (as this can be easily faked). We strongly advise to be vigilant and stay safe throughout the launch. Don’t let the excitement get the best of you.

Just be sure you have enough BNB in your wallet to cover the transaction fees.

Join To Get BNB (Binance Coin)! ☞ CLICK HERE

You will have to first buy one of the major cryptocurrencies, usually either Bitcoin (BTC), Ethereum (ETH), Tether (USDT), Binance (BNB)…

We will use Binance Exchange here as it is one of the largest crypto exchanges that accept fiat deposits.

Once you finished the KYC process. You will be asked to add a payment method. Here you can either choose to provide a credit/debit card or use a bank transfer, and buy one of the major cryptocurrencies, usually either Bitcoin (BTC), Ethereum (ETH), Tether (USDT), Binance (BNB)…

☞ SIGN UP ON BINANCE

Step by Step Guide : What is Binance | How to Create an account on Binance (Updated 2021)

Next step

You need a wallet address to Connect to Pancakeswap Decentralized Exchange, we use Metamask wallet

If you don’t have a Metamask wallet, read this article and follow the steps ☞ What is Metamask wallet | How to Create a wallet and Use

Transfer $BNB to your new Metamask wallet from your existing wallet

Next step

Connect Metamask Wallet to Pancakeswap Decentralized Exchange and Buy, Swap CARS token

Contract: 0x1228Fb5eF4C98CaBd696Ba1BD4819e050389D21A

Read more: What is Pancakeswap | Beginner’s Guide on How to Use Pancakeswap

The top exchange for trading in CARS token is currently: PancakeSwap v2

Find more information CARS token

☞ Website ☞ Explorer  ☞ Social Channel ☞ Social Channel 2 ☞ Social Channel 3  ☞ Coinmarketcap

Top exchanges for token-coin trading. Follow instructions and make unlimited money

BinanceBittrexPoloniexBitfinexHuobiMXCProBITGate.ioCoinbase

🔺DISCLAIMER: The Information in the post isn’t financial advice, is intended FOR GENERAL INFORMATION PURPOSES ONLY. Trading Cryptocurrency is VERY risky. Make sure you understand these risks and that you are responsible for what you do with your money.

🔥 If you’re a beginner. I believe the article below will be useful to you ☞ What You Should Know Before Investing in Cryptocurrency - For Beginner

⭐ ⭐ ⭐The project is of interest to the community. Join to Get free ‘GEEK coin’ (GEEKCASH coin)!

☞ **-----https://geekcash.org-----**⭐ ⭐ ⭐

I hope this post will help you. Don't forget to leave a like, comment and sharing it with others. Thank you!

#bitcoin #cryptocurrency

What is GEEK

Buddha Community

What is Crypto Cars Worl (CARS) | What is CARS token
Aylin Hazel

Aylin Hazel

1648115675

Germany: 44% Will Invest in #Crypto and Join ‘The Future of Finance’

Germany was the first country to recognize #Bitcoins as “units of value” and that they could be classified as a “financial instrument.”

Legal regulation for the decentralized industry in Germany is ongoing. Now, 16% of the German population 18 to 60 are #crypto investors.

These people who own #cryptocurrencies or have traded cryptocurrencies in the past six months.

41% of these #crypto investors intend to increase the share of their investments in #crypto in the next six months. Another 13% of Germans are #crypto-curious.

They intend to invest in #cryptocurrencies too. Yet, only 23% of the #crypto-curious said they are highly likely to invest, with the rest remaining hesitant.

Tamia  Walter

Tamia Walter

1593883260

How to Build an On-Demand Car Wash App And How Much Does It Cost?

As many industries are going through a lot in the US and across the world. The carwash industry is one of the industries whose demand is never-ending across the country. From a report given by IBISWorld Industry, the annual revenue over a five-year period from 2016-2021 is estimated at about $10.2 billion with $1.9 billion in profit.

The car wash services are very important and necessary for car owners to maintain their car look and feel better. Many people think that lockdown might take this business downside, but the important fact is that every vehicle owner takes this as an opportunity to maintain their cars at a good outlook and appearance. There is an enormous market for the on-demand car washing market which you should make benefit out of it.

The amount of 75% of car owners avails car washing services in the US. As you will know, it is more effortless to bring in customers to your business by making the most out of the digital marketing strategies. The first step in building the digital value for your business is through a sleek website and a seamless mobile application. When it comes to car wash business, the On-demand application is the best choice to attract new costumers and retain old customers.

Many businesses have transformed their services by developing applications on both iOS and Android platforms. With the next-generation technology, make the most out of the present opportunities.

You shouldn’t build an On-demand Car wash Application without reading this article.

**ALSO READ: **How To Build A Custom CRM From Scratch

This comprehensive blog is to help you decide on how to strategically build your On-demand Car wash Application for your business or as a car wash business marketplace.

Read this article to find answers to the questions in your mind about building a car wash mobile application that will help you make the right decisions. Being a technology specialist Agira technologies have always been serving startups and help entrepreneurs break through the struggles in converting the intellectual business idea into reality.

This is the generation, where peoples use the internet to buy products and started to buy from the company mobile app itself. This mobile app technology influenced all the businesses including the car wash industry also.

Must-have Features of On-Demand Car Wash Application

When you are building a mobile application, it is important to understand the requirements of your business and especially the customers. The users of this application should feel comfortable using the application to make use of the car washing services around their neighborhood.

If you are starting a business, and building an application to support your business, it is better to launch the application with a minimum viable product and then add up the additional features according to the requirements of your customers or by studying their behavior on using the application.

  • User Registration
  • Service Request
  • Geolocation
  • Service Packages
  • Service Availability
  • Multiple payment options
  • Push Notifications

Desirable Features

  • Social Sign-in
  • Reviews and Ratings
  • Order history
  • Heat Map view
  • Discounts and offers
  • Loyalty programs

Admin App Features

  • Order Management
  • Profile Management
  • Schedule Management
  • Wallet Management

To build a complete application that can cater to the business needs and the logic would require a strong backend that can work effectively in any situation and a front end development that lets the customers immerse into the application.

Also, as an entrepreneur, you should be able to decide if you want to build native applications on both platforms or opt for cross-platform application development. Each application development involves its own pros and cons. So, it is important to find the right application development approach that is suitable for your business, budget, and time frame.

**ALSO READ: **How to Build a Local Events App Like Eventbrite and YPlan

How Much Does It Cost To Build A Car Wash Application?

After deciding on the features for your minimum viable product, you can come up with the approximate number that cost to build an On-Demand car wash application. As already mentioned, every feature that is added to application results in adding up more time to build. As you will pay the application developers on an hourly basis, the more it takes to develop, it cost you more. This means that more features approach is equal to an increase in development cost, delay in time to market.

To build a top-notch mobile application, you will need to hire a mobile application development company or hire a team of development teams. In order to build an enterprise application, you will need a development team of the following.

  • UI/UX Designers
  • Backend Developer
  • Android Developers and iOS Developers or cross-platform developers
  • QA Specialists
  • Project Manager

If you want to know the exact cost of building an On-demand Car Wash application, plan your idea, list your requirements, and contact us to get a precise cost estimation for your business project.

We, Agira technologies are a technology solution company with business services and domain solutions that support global clients who comprise the current world economy. Some of the exclusive services that we offer are web development, mobile app development, Blockchain, IoT, and DevOps Consulting.

Do you find it interesting? you might also like these articles. Top 10 Best Tech Companies For Employees To Work In The USA In 2020 and Top 10 IT Staffing and Recruiting Agencies in the USA.

If you have a business idea in your mind and search for a reliable web development company, you are in the right place. Hire the best web developers in the industry from Agira technologies.

Looking For A Tech Partner To Domina

#enterprise application #automatic car wash #car wash android app #car wash app india #car wash booking app #diy car wash near me #how to make a car wash app #manual car wash near me #self car wash near me

Creating Winning Car Dealer Websites

When a developer creates a car dealer website, he needs to keep several things in mind. Instead of following a generic template to build a car dealer website, a developer should take an in-depth overview of the purpose of the website and create it accordingly.

The top kinds of car dealer websites include car dealer inventory website and used car dealer website, and a developer needs to go ahead with car dealer website design accordingly.

Car Dealer Website

So car dealer website development should be conducted according to the template and the range of options available before a developer should not overwhelm a developer. There are nevertheless some best design practices that work for all car dealer websites. They create winning websites and deliver a matchless first impression.

Just as an instance, navigation tools should be made to be eye-catching and the CTAs should be innovatively placed at a familiar location. They may be made static. Using the best practices, a developer should be able to come up with a matchless WordPress car dealer website. While being oriented towards the end-user, the website should simplify the dealership experience as well.

Adding in functionalities within car dealer website

A car dealership website is likely to require a range of add-in functionalities for simplifying its use and delivering value. This may be accomplished through coding or seamlessly integrating third-party software.

Just as an instance, a visitor should be able to search among the options available easily, based upon parameters such as petrol-driven or diesel driven, make, model, MRP, and savings. Cross search should be enabled. Similarly, if a visitor can compare two cars he likes, it boosts the odds of conversion. A clear idea of pricing and financial information will further enhance the odds of making a purchase and makes it easier for a consumer to find the best deal.

Placing the CTAs right also helps with the same. 360-degree images, magnifying glass, personalized suggestions, and product description further delivers value to search. Over 30% of visitors to your website will use the search functionality.

Car dealer responsive website

A dealer should come up with a fully responsive car dealer website because most of the visitors will view and use the website over their mobile devices. Other features that a car dealer website should have include pricing and finance calculators, ease of finding limited-time offers, friction-free forms, and easy to add reviews and testimonials. Professional car dealer website providers will be in the best position to create a winning Auto dealer websites for your enterprise.

#car website #used car website #car dealer website #best car dealer websites #car dealer website template #wordpress car dealer website

Royce  Reinger

Royce Reinger

1658068560

WordsCounted: A Ruby Natural Language Processor

WordsCounted

We are all in the gutter, but some of us are looking at the stars.

-- Oscar Wilde

WordsCounted is a Ruby NLP (natural language processor). WordsCounted lets you implement powerful tokensation strategies with a very flexible tokeniser class.

Features

  • Out of the box, get the following data from any string or readable file, or URL:
    • Token count and unique token count
    • Token densities, frequencies, and lengths
    • Char count and average chars per token
    • The longest tokens and their lengths
    • The most frequent tokens and their frequencies.
  • A flexible way to exclude tokens from the tokeniser. You can pass a string, regexp, symbol, lambda, or an array of any combination of those types for powerful tokenisation strategies.
  • Pass your own regexp rules to the tokeniser if you prefer. The default regexp filters special characters but keeps hyphens and apostrophes. It also plays nicely with diacritics (UTF and unicode characters): Bayrūt is treated as ["Bayrūt"] and not ["Bayr", "ū", "t"], for example.
  • Opens and reads files. Pass in a file path or a url instead of a string.

Installation

Add this line to your application's Gemfile:

gem 'words_counted'

And then execute:

$ bundle

Or install it yourself as:

$ gem install words_counted

Usage

Pass in a string or a file path, and an optional filter and/or regexp.

counter = WordsCounted.count(
  "We are all in the gutter, but some of us are looking at the stars."
)

# Using a file
counter = WordsCounted.from_file("path/or/url/to/my/file.txt")

.count and .from_file are convenience methods that take an input, tokenise it, and return an instance of WordsCounted::Counter initialized with the tokens. The WordsCounted::Tokeniser and WordsCounted::Counter classes can be used alone, however.

API

WordsCounted

WordsCounted.count(input, options = {})

Tokenises input and initializes a WordsCounted::Counter object with the resulting tokens.

counter = WordsCounted.count("Hello Beirut!")

Accepts two options: exclude and regexp. See Excluding tokens from the analyser and Passing in a custom regexp respectively.

WordsCounted.from_file(path, options = {})

Reads and tokenises a file, and initializes a WordsCounted::Counter object with the resulting tokens.

counter = WordsCounted.from_file("hello_beirut.txt")

Accepts the same options as .count.

Tokeniser

The tokeniser allows you to tokenise text in a variety of ways. You can pass in your own rules for tokenisation, and apply a powerful filter with any combination of rules as long as they can boil down into a lambda.

Out of the box the tokeniser includes only alpha chars. Hyphenated tokens and tokens with apostrophes are considered a single token.

#tokenise([pattern: TOKEN_REGEXP, exclude: nil])

tokeniser = WordsCounted::Tokeniser.new("Hello Beirut!").tokenise

# With `exclude`
tokeniser = WordsCounted::Tokeniser.new("Hello Beirut!").tokenise(exclude: "hello")

# With `pattern`
tokeniser = WordsCounted::Tokeniser.new("I <3 Beirut!").tokenise(pattern: /[a-z]/i)

See Excluding tokens from the analyser and Passing in a custom regexp for more information.

Counter

The WordsCounted::Counter class allows you to collect various statistics from an array of tokens.

#token_count

Returns the token count of a given string.

counter.token_count #=> 15

#token_frequency

Returns a sorted (unstable) two-dimensional array where each element is a token and its frequency. The array is sorted by frequency in descending order.

counter.token_frequency

[
  ["the", 2],
  ["are", 2],
  ["we",  1],
  # ...
  ["all", 1]
]

#most_frequent_tokens

Returns a hash where each key-value pair is a token and its frequency.

counter.most_frequent_tokens

{ "are" => 2, "the" => 2 }

#token_lengths

Returns a sorted (unstable) two-dimentional array where each element contains a token and its length. The array is sorted by length in descending order.

counter.token_lengths

[
  ["looking", 7],
  ["gutter",  6],
  ["stars",   5],
  # ...
  ["in",      2]
]

#longest_tokens

Returns a hash where each key-value pair is a token and its length.

counter.longest_tokens

{ "looking" => 7 }

#token_density([ precision: 2 ])

Returns a sorted (unstable) two-dimentional array where each element contains a token and its density as a float, rounded to a precision of two. The array is sorted by density in descending order. It accepts a precision argument, which must be a float.

counter.token_density

[
  ["are",     0.13],
  ["the",     0.13],
  ["but",     0.07 ],
  # ...
  ["we",      0.07 ]
]

#char_count

Returns the char count of tokens.

counter.char_count #=> 76

#average_chars_per_token([ precision: 2 ])

Returns the average char count per token rounded to two decimal places. Accepts a precision argument which defaults to two. Precision must be a float.

counter.average_chars_per_token #=> 4

#uniq_token_count

Returns the number of unique tokens.

counter.uniq_token_count #=> 13

Excluding tokens from the tokeniser

You can exclude anything you want from the input by passing the exclude option. The exclude option accepts a variety of filters and is extremely flexible.

  1. A space-delimited string. The filter will normalise the string.
  2. A regular expression.
  3. A lambda.
  4. A symbol that names a predicate method. For example :odd?.
  5. An array of any combination of the above.
tokeniser =
  WordsCounted::Tokeniser.new(
    "Magnificent! That was magnificent, Trevor."
  )

# Using a string
tokeniser.tokenise(exclude: "was magnificent")
# => ["that", "trevor"]

# Using a regular expression
tokeniser.tokenise(exclude: /trevor/)
# => ["magnificent", "that", "was", "magnificent"]

# Using a lambda
tokeniser.tokenise(exclude: ->(t) { t.length < 4 })
# => ["magnificent", "that", "magnificent", "trevor"]

# Using symbol
tokeniser = WordsCounted::Tokeniser.new("Hello! محمد")
tokeniser.tokenise(exclude: :ascii_only?)
# => ["محمد"]

# Using an array
tokeniser = WordsCounted::Tokeniser.new(
  "Hello! اسماءنا هي محمد، كارولينا، سامي، وداني"
)
tokeniser.tokenise(
  exclude: [:ascii_only?, /محمد/, ->(t) { t.length > 6}, "و"]
)
# => ["هي", "سامي", "وداني"]

Passing in a custom regexp

The default regexp accounts for letters, hyphenated tokens, and apostrophes. This means twenty-one is treated as one token. So is Mohamad's.

/[\p{Alpha}\-']+/

You can pass your own criteria as a Ruby regular expression to split your string as desired.

For example, if you wanted to include numbers, you can override the regular expression:

counter = WordsCounted.count("Numbers 1, 2, and 3", pattern: /[\p{Alnum}\-']+/)
counter.tokens
#=> ["numbers", "1", "2", "and", "3"]

Opening and reading files

Use the from_file method to open files. from_file accepts the same options as .count. The file path can be a URL.

counter = WordsCounted.from_file("url/or/path/to/file.text")

Gotchas

A hyphen used in leu of an em or en dash will form part of the token. This affects the tokeniser algorithm.

counter = WordsCounted.count("How do you do?-you are well, I see.")
counter.token_frequency

[
  ["do",   2],
  ["how",  1],
  ["you",  1],
  ["-you", 1], # WTF, mate!
  ["are",  1],
  # ...
]

In this example -you and you are separate tokens. Also, the tokeniser does not include numbers by default. Remember that you can pass your own regular expression if the default behaviour does not fit your needs.

A note on case sensitivity

The program will normalise (downcase) all incoming strings for consistency and filters.

Roadmap

Ability to open URLs

def self.from_url
  # open url and send string here after removing html
end

Are you using WordsCounted to do something interesting? Please tell me about it.

Gem Version 

RubyDoc documentation.

Demo

Visit this website for one example of what you can do with WordsCounted.


Contributors

See contributors.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Author: Abitdodgy
Source Code: https://github.com/abitdodgy/words_counted 
License: MIT license

#ruby #nlp 

Words Counted: A Ruby Natural Language Processor.

WordsCounted

We are all in the gutter, but some of us are looking at the stars.

-- Oscar Wilde

WordsCounted is a Ruby NLP (natural language processor). WordsCounted lets you implement powerful tokensation strategies with a very flexible tokeniser class.

Are you using WordsCounted to do something interesting? Please tell me about it.

 

Demo

Visit this website for one example of what you can do with WordsCounted.

Features

  • Out of the box, get the following data from any string or readable file, or URL:
    • Token count and unique token count
    • Token densities, frequencies, and lengths
    • Char count and average chars per token
    • The longest tokens and their lengths
    • The most frequent tokens and their frequencies.
  • A flexible way to exclude tokens from the tokeniser. You can pass a string, regexp, symbol, lambda, or an array of any combination of those types for powerful tokenisation strategies.
  • Pass your own regexp rules to the tokeniser if you prefer. The default regexp filters special characters but keeps hyphens and apostrophes. It also plays nicely with diacritics (UTF and unicode characters): Bayrūt is treated as ["Bayrūt"] and not ["Bayr", "ū", "t"], for example.
  • Opens and reads files. Pass in a file path or a url instead of a string.

Installation

Add this line to your application's Gemfile:

gem 'words_counted'

And then execute:

$ bundle

Or install it yourself as:

$ gem install words_counted

Usage

Pass in a string or a file path, and an optional filter and/or regexp.

counter = WordsCounted.count(
  "We are all in the gutter, but some of us are looking at the stars."
)

# Using a file
counter = WordsCounted.from_file("path/or/url/to/my/file.txt")

.count and .from_file are convenience methods that take an input, tokenise it, and return an instance of WordsCounted::Counter initialized with the tokens. The WordsCounted::Tokeniser and WordsCounted::Counter classes can be used alone, however.

API

WordsCounted

WordsCounted.count(input, options = {})

Tokenises input and initializes a WordsCounted::Counter object with the resulting tokens.

counter = WordsCounted.count("Hello Beirut!")

Accepts two options: exclude and regexp. See Excluding tokens from the analyser and Passing in a custom regexp respectively.

WordsCounted.from_file(path, options = {})

Reads and tokenises a file, and initializes a WordsCounted::Counter object with the resulting tokens.

counter = WordsCounted.from_file("hello_beirut.txt")

Accepts the same options as .count.

Tokeniser

The tokeniser allows you to tokenise text in a variety of ways. You can pass in your own rules for tokenisation, and apply a powerful filter with any combination of rules as long as they can boil down into a lambda.

Out of the box the tokeniser includes only alpha chars. Hyphenated tokens and tokens with apostrophes are considered a single token.

#tokenise([pattern: TOKEN_REGEXP, exclude: nil])

tokeniser = WordsCounted::Tokeniser.new("Hello Beirut!").tokenise

# With `exclude`
tokeniser = WordsCounted::Tokeniser.new("Hello Beirut!").tokenise(exclude: "hello")

# With `pattern`
tokeniser = WordsCounted::Tokeniser.new("I <3 Beirut!").tokenise(pattern: /[a-z]/i)

See Excluding tokens from the analyser and Passing in a custom regexp for more information.

Counter

The WordsCounted::Counter class allows you to collect various statistics from an array of tokens.

#token_count

Returns the token count of a given string.

counter.token_count #=> 15

#token_frequency

Returns a sorted (unstable) two-dimensional array where each element is a token and its frequency. The array is sorted by frequency in descending order.

counter.token_frequency

[
  ["the", 2],
  ["are", 2],
  ["we",  1],
  # ...
  ["all", 1]
]

#most_frequent_tokens

Returns a hash where each key-value pair is a token and its frequency.

counter.most_frequent_tokens

{ "are" => 2, "the" => 2 }

#token_lengths

Returns a sorted (unstable) two-dimentional array where each element contains a token and its length. The array is sorted by length in descending order.

counter.token_lengths

[
  ["looking", 7],
  ["gutter",  6],
  ["stars",   5],
  # ...
  ["in",      2]
]

#longest_tokens

Returns a hash where each key-value pair is a token and its length.

counter.longest_tokens

{ "looking" => 7 }

#token_density([ precision: 2 ])

Returns a sorted (unstable) two-dimentional array where each element contains a token and its density as a float, rounded to a precision of two. The array is sorted by density in descending order. It accepts a precision argument, which must be a float.

counter.token_density

[
  ["are",     0.13],
  ["the",     0.13],
  ["but",     0.07 ],
  # ...
  ["we",      0.07 ]
]

#char_count

Returns the char count of tokens.

counter.char_count #=> 76

#average_chars_per_token([ precision: 2 ])

Returns the average char count per token rounded to two decimal places. Accepts a precision argument which defaults to two. Precision must be a float.

counter.average_chars_per_token #=> 4

#uniq_token_count

Returns the number of unique tokens.

counter.uniq_token_count #=> 13

Excluding tokens from the tokeniser

You can exclude anything you want from the input by passing the exclude option. The exclude option accepts a variety of filters and is extremely flexible.

  1. A space-delimited string. The filter will normalise the string.
  2. A regular expression.
  3. A lambda.
  4. A symbol that names a predicate method. For example :odd?.
  5. An array of any combination of the above.
tokeniser =
  WordsCounted::Tokeniser.new(
    "Magnificent! That was magnificent, Trevor."
  )

# Using a string
tokeniser.tokenise(exclude: "was magnificent")
# => ["that", "trevor"]

# Using a regular expression
tokeniser.tokenise(exclude: /trevor/)
# => ["magnificent", "that", "was", "magnificent"]

# Using a lambda
tokeniser.tokenise(exclude: ->(t) { t.length < 4 })
# => ["magnificent", "that", "magnificent", "trevor"]

# Using symbol
tokeniser = WordsCounted::Tokeniser.new("Hello! محمد")
tokeniser.tokenise(exclude: :ascii_only?)
# => ["محمد"]

# Using an array
tokeniser = WordsCounted::Tokeniser.new(
  "Hello! اسماءنا هي محمد، كارولينا، سامي، وداني"
)
tokeniser.tokenise(
  exclude: [:ascii_only?, /محمد/, ->(t) { t.length > 6}, "و"]
)
# => ["هي", "سامي", "وداني"]

Passing in a custom regexp

The default regexp accounts for letters, hyphenated tokens, and apostrophes. This means twenty-one is treated as one token. So is Mohamad's.

/[\p{Alpha}\-']+/

You can pass your own criteria as a Ruby regular expression to split your string as desired.

For example, if you wanted to include numbers, you can override the regular expression:

counter = WordsCounted.count("Numbers 1, 2, and 3", pattern: /[\p{Alnum}\-']+/)
counter.tokens
#=> ["numbers", "1", "2", "and", "3"]

Opening and reading files

Use the from_file method to open files. from_file accepts the same options as .count. The file path can be a URL.

counter = WordsCounted.from_file("url/or/path/to/file.text")

Gotchas

A hyphen used in leu of an em or en dash will form part of the token. This affects the tokeniser algorithm.

counter = WordsCounted.count("How do you do?-you are well, I see.")
counter.token_frequency

[
  ["do",   2],
  ["how",  1],
  ["you",  1],
  ["-you", 1], # WTF, mate!
  ["are",  1],
  # ...
]

In this example -you and you are separate tokens. Also, the tokeniser does not include numbers by default. Remember that you can pass your own regular expression if the default behaviour does not fit your needs.

A note on case sensitivity

The program will normalise (downcase) all incoming strings for consistency and filters.

Roadmap

Ability to open URLs

def self.from_url
  # open url and send string here after removing html
end

Contributors

See contributors.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Author: abitdodgy
Source code: https://github.com/abitdodgy/words_counted
License: MIT license

#ruby  #ruby-on-rails