Crypto Like

Crypto Like

1634781869

What is DeCus (SATS) | What is DeCus token | What is SATS token

In this article, we'll discuss information about the DeCus project and SATS token. 

DeCus is a decentralized and high-performance cross-chain platform dedicated to bringing Bitcoin to the DeFi ecosystem and making other blockchain assets flow freely across different chains.

What are pegged value crypto assets?

Pegged value crypto assets are tokens that have their value pegged to an underlying asset by some means. The most common type of pegged value crypto assets is stable coin, of which the value is supposed to be $1.

Different pegged value crypto assets fix this value using different mechanisms. Some maintain their peg synthetically, like sUSD, other by being backed by the the actual underlying asset, like USDT.

These different approaches and the associated risks are why the prices of pegged value crypto assets of the same type can vary slightly.

What is tokenized bitcoin?

Tokenized bitcoin is another frequently used pegged value crypto assets. The underlying assets, BTC, is kept in some ways and then a certain party will mint or issue a token on other blockchains that has the same value as regular BTC but can be used to the full capability of a token. Some examples of tokenized bitcoin include WBTC, HBTC, tBTC, renBTC, sBTC and so forth.

What is SATS?

SATS is a brand new generation of tokenized bitcoin with smaller unit and enhanced performance. SATS is pegged to 1 Satoshi, the smallest unit of Bitcoin, and backed by real BTC in the Bitcoin network. As the first use case of DeCus, SATS provides a better solution for tokenized bitcoin with improved efficiency and decreased risk in a truly decentralized way.

Why is DeCus launching with tokenized bitcoin?

2020 has seen a big blossom of DeFi applications on Ethereum Network and other smart contract chains , while bitcoin, the largest cryptocurrency by market capitalization, is incompatible with the current DeFi structure. The incompatibility makes bitcoin holders outsiders of the prosperous DeFi world, meaning that they cannot enjoy DeFi services, as well as the opportunities of liquidity mining and farming in DeFi.

Some projects are already working on addressing this problem and the amount of tokenized BTC has been exploding - the number of supply has increased almost 135X in 2020, from 1040 to 138,530. Despite this growth, tokenized BTC merely accounts for 0.75% of the circulating supply of real BTC.

The mission of DeCus is to make value flow across different blockchains, so in order to bring value as well as liquidity of BTC, the first-class citizen in cryptocurrency, DeCus decided to launch with SATS, a better tokenized bitcoin to satisfy the tremendous market demand.

Who built DeCus?

DeCus is built by a group of decentralization believers and DeFi natives with prior years of developer experience at leading companies both in Internet and blockchain field, with theoretical research being led by a Dr. team from the top-level computer science and cryptography major throughout the world.

Will DeCus build a bitcoin bridge on other chains?

Yes. After the successful launch on Binance Smart Chain(BSC), the solution can be expanded to more public blockchains such as Ethereum network, Polygon, Polkadot, Conflux, Nervos and Near Protocol, etc.

Is DeCus safe?

Security is always the top priority at DeCus. Our core code is being audited by an industry-leading company. Once accomplished, the audit report will be published on our website.

In addition, DeCus is working widely with several professional teams to test the financial infrastructure of the protocol resilience to attacks by corrupted keepers as well as incentives for honest participants.

But we still know that our protocol depends on new technology that may contain undiscovered vulnerabilities, so we encourage the community to audit t contracts and security.

Mechanism

How does the system work?

As the core role of whole system, Keeper Network is responsible for the custody of underlying crypto assets and provides crypto collaterals against system security risk.

Running nodes is another responsibility for Keeper. They need a cloud server to configure private key of Ethereum Network to verify identity and interact with smart contracts, and to generate a pair of keys to initiate and verify Bitcoin multi-sig transactions.

Smart contracts deployed on target blockchains will mint the relevant pegged value crypto assets. The whole process is organized in a 100% decentralized way given Keepers are permission-less to join or leave the Network at will. Users can cross chain their crypto assets in a secure and decentralized way up to a capacity backed by the crypto collaterals provided by the Keepers Network.

Due to the exclusive algorithm of DeCus, Keepers are managed to be decentralized custodians at a low collateralization rate, with the security of custody still being guaranteed, thus improving the utilization rate of crypto assets.

DeCus is launching with tokenized bitcoin, SATS, on the Binance Smart Chain. The following picture shows how bitcoin can be turned to SATS.

How to mint SATS?

One user who wants to mint SATS should first submit a request to the smart contract on Binance Smart Chain and then get a multi-sig BTC address of a designated keepers group. After depositing a certain amount BTC to that multi-sig address and submitting the proof of deposit, the corresponding amount of SATS will be sent to the user’s BSC address.

Users are able to convert their SATS back to BTC at any time. The redeeming process is similar with minting. Once the original BTC is received, the corresponding SATS will be burnt.

What is the underlying method?

A decentralized and self-regulated Keeper Network based on Dr. Yang Guang’s cryptography IP is the cornerstone of whole system.

Suppose the BTC assets are kept by 10,000 custodians in a multi-sig address from which every transaction needs at least 5,001 signatures. As long as the majority of custodians remain honest, an adversary cannot steal any BTC under custody. In this case, a minimum collateral would be sufficient to enforce correct behavior of custodians.

However, a 5,001 of 10,000 multi-sig address would be technically challenged to use on Bitcoin network, and the composition of a transaction with 5,001 signatures would require non-trivial coordination among all custodians.

To balance the security provided by large groups and accessibility by small groups, DeCus introduced a custody scheme based on overlapping group assignments. The following toy example will show how it works.

Suppose there are six custodians partitioned in two 2-of-3 multi-sig groups each of three custodians. Then by corrupting two custodians the adversary is able to get full control of one group, which is 1/2 of the total assets under custody.

Alternatively, let’s enumerate all 2-of-3 multi-sig groups drawn from the six custodians. There are 20 groups in total, whereas by corrupting two custodians the adversary only controls four groups (each corrupted group consists of two corrupted custodian and another honest one). Thus, the same 1/3 fraction of adversary only controls 4/20=1/5 of all groups. In other words, the new scheme is able to securely keep 5 BTC with total collateral of 3 BTC against 1/3 adversary, since the profit of launching an attack does not exceed the adversary’s collateral.

Of course, the above toy example is designed for illustration but not impressive collateral efficiency. We can estimate the ratio of collateral to total assets under custody asymptotically as follows:

Based on the above analysis, DeCus implements the decentralized custody scheme with fewer groups in representative, and achieves impressive low collateral ratio.For example, with a polynomial design over prime fields, DeCus is able to achieve efficiency factor η=A/C as much as 20 with n=121 custodians, which means the collateral is <5% of total assets under custody!

Who are the Keepers? Can anyone become a Keeper?

Keepers are responsible for the custody of underlying crypto assets. All keepers are organied under the overlapping group assignments in a 100% decentralized way , and they need to deposit collaterals in case of misbehaviors.

DeCus will soon launch a permission-less Dutch Auction to select the first batch of Keepers. Anyone who is interested to be a Keeper can participate the auction without any KYC or AML processes.

After several rounds of iterations and the system enters the mature operation stage, Keepers can join and leave freely under the new mechanism. For every user's deposit, a new Keepers group is pulled together (selected by the random beacon), and they generate a Bitcoin multi-sig address for the depositor, which is marked on the Binance Smart Chain.

Why do we launch a Dutch Auction? How does the Dutch Auction work?

The stable operation of system relays on Keeper Network. If the number of Keepers is too small, the whole system will become insecure. So we need an efficient and fair way to initiate a bootstrap process of the Keeper Network. Under current circumstances, Ductch Auction seems to be the best way because of two features: 1) Permission-less, which means anyone who wants to be a Keeper can participate in the auction; 2) Transparent, which means all participants can compete fairly under the set rules; 3) Participation discovery, which means the real willingness to become a Keeper can be figured out through the whole process.

During the auction, candidates need to set the amount of deposit they would like to commit, according to which the system will rank in real time. By the end of the auction, the top n will be selected, with the n-th committed deposit amount being used as the final deposit amount for each selected keeper. During the auction stage, the deposit can be retrieved at any time. Once auction ended, the mint stage will launch at which the Keepers' collateral will be migrated to the Vault of Keeper Network and each Keeper operates his/her node of the Keeper Network.

How can a Keeper benefits from the system?

As the core role and long-term partners of whole system,Keepers will receive mostly 3 parts of benefits: 1) Share of system revenue, which is generated from the fees of SATS(or other pegged value crypto assets) minting and redemption. 2) Collateral interests, namely the deposit interests of Keeper collaterals. SATS is the first tokenized bitcoin that gives such interests to the custody party of underlying assets. 3) Farming yields, which will be generated by integrating crypto collaterals into yield farming protocols such as DODO, Venus and Fortube, etc. Whether authorize the system to farm is determined by Keeper itself.

Why is SATS better than other tokenized bitcoins?

Decentralization and scalability are well balanced by SATS compared to other tokenized bitcoins.

Some tokenized bitcoins, like WBTC and HBTC, are issued by a centralized party, so they may become irredeemable in case of a single point failure or censorship.

Other BTC-backed tokens, such as tBTC and renBTC, are issued in a decentralized way. However, they rely on a high collateralization rate to mitigate the risk of price fluctuation and misbehavior. For example, each minted tBTC-token requires collateral of value ≥1.5BTC, and each renBTC requires collateral value ≥3BTC. Such over-collateralization would significantly increase the cost of using tokenized bitcoins.

SATS gives a different answer. The decentralized and self-regulated Keeper Network of the system enables SATS implementation at a much lower collateralization rate, with 30%-50% compared to the average more than 150% of other solutions, while still kept decentralized.

How about governance?

Given DeCus as a decentralized custody system and SATS as an underlying asset protocol within the DeFi building blocks , it's intended that DeCus starts as a community-driven initiative from day one, and eventually goes to DAO governance.

Community members can propose ideas and votes on proposals in DeCus DAO where DeCus shall head towards. Once the proposals are passed, DeCus team will be responsible to carry them out.

Of course, all of our team members are open and willing to collaborate with anyone wanting to build with together. It would be amazing to see leading developers and DeFi protocols participate in this program.

DCS token 

The total supply of DCS tokens is 1 billion, and the overall token allocation is illustrated in the following picture.

What is the DCS token’s contract address?

0x7AAe5d16020c678b533cB4624977B0E3bB1125A5

How can I earn DCS tokens?

There are two main roles in the DeCus system, Keeper and User, and both can earn DCS tokens.

As a Keeper, you need to run a Keeper Node, deposit collaterals, and undertake the custody task(i.e sign transactions). Then you can get DCS tokens as rewards.

To find out more about how the Keeper works, please check out the KEEPERS' GUIDES.

Users refer to those who deposit their native bitcoins to the DeCus system and get BTC-pegged tokens(SATS) back, and those who use the BTC-pegged tokens(SATS) built by the DeCus system.

Users can harvest DCS tokens by minting SATS, or staking LP tokens. Currently, our platform only supports WBTC-SATS LP tokens from PancakeSwap and DODO DEX.

How long is the vesting schedule?

Currently, the participant incentives are planned to vest throughout a 6-year time period with a yearly decay coefficient of 0.666.

How many tokens are released every year?

Out of the 1 billion total supply of DCS, 45% will be used to incentivize protocol participants, which includes User incentive (30%) and Keeper incentive (15%).

The incentive for Users will be released directly over that period. The incentive for the Keepers will be awarded gradually during the first 66 months, and when awarded 50% will remain locked for 6 more months, and then released in 6 monthly installments. Detail distribution programs will be adjusted every two weeks to stabilize APR under the overall framework.

The detailed distribution schedules are as below:

- DCS Supply for Participant Incentive

- Accumulative Released DCS for Participant Incentive

- Accumulative Released DCS for Participant Incentive

Contracts

SATS: 0xA258B20C6e6220dcF7Cd523Ff39847fEc7A6A0CF

DCS: 0x7AAe5d16020c678b533cB4624977B0E3bB1125A5

KeeperRegistry: 0x750F90bB0764139568383AbE0784565a3cD6a318

DeCusSystem: 0xB4b9fCa2553FcE552aba3eb33deE2B9057bf88d1

KeeperReward: 0x00D8f5e3E727D8ADF0607D1a6ed6DDEB81E6a3B5

​How and Where to Buy SATS token?

SATS token is now live on the Binance mainnet. The token address for SATS is 0xA258B20C6e6220dcF7Cd523Ff39847fEc7A6A0CF. 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 SATS token

Contract: 0xA258B20C6e6220dcF7Cd523Ff39847fEc7A6A0CF

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

The top exchange for trading in SATS token is currently: PancakeSwap (V2)

Find more information SATS 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 DeCus (SATS) | What is DeCus token | What is SATS token

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 

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 

aaron silva

aaron silva

1622197808

SafeMoon Clone | Create A DeFi Token Like SafeMoon | DeFi token like SafeMoon

SafeMoon is a decentralized finance (DeFi) token. This token consists of RFI tokenomics and auto-liquidity generating protocol. A DeFi token like SafeMoon has reached the mainstream standards under the Binance Smart Chain. Its success and popularity have been immense, thus, making the majority of the business firms adopt this style of cryptocurrency as an alternative.

A DeFi token like SafeMoon is almost similar to the other crypto-token, but the only difference being that it charges a 10% transaction fee from the users who sell their tokens, in which 5% of the fee is distributed to the remaining SafeMoon owners. This feature rewards the owners for holding onto their tokens.

Read More @ https://bit.ly/3oFbJoJ

#create a defi token like safemoon #defi token like safemoon #safemoon token #safemoon token clone #defi token

aaron silva

aaron silva

1621844791

SafeMoon Clone | SafeMoon Token Clone | SafeMoon Token Clone Development

The SafeMoon Token Clone Development is the new trendsetter in the digital world that brought significant changes to benefit the growth of investors’ business in a short period. The SafeMoon token clone is the most widely discussed topic among global users for its value soaring high in the marketplace. The SafeMoon token development is a combination of RFI tokenomics and the auto-liquidity generating process. The SafeMoon token is a replica of decentralized finance (DeFi) tokens that are highly scalable and implemented with tamper-proof security.

The SafeMoon tokens execute efficient functionalities like RFI Static Rewards, Automated Liquidity Provisions, and Automatic Token Burns. The SafeMoon token is considered the most advanced stable coin in the crypto market. It gained global audience attention for managing the stability of asset value without any fluctuations in the marketplace. The SafeMoon token clone is completely decentralized that eliminates the need for intermediaries and benefits the users with less transaction fee and wait time to overtake the traditional banking process.

Reasons to invest in SafeMoon Token Clone :

  • The SafeMoon token clone benefits the investors with Automated Liquidity Pool as a unique feature since it adds more revenue for their business growth in less time. The traders can experience instant trade round the clock for reaping profits with less investment towards the SafeMoon token.
  • It is integrated with high-end security protocols like two-factor authentication and signature process to prevent various hacks and vulnerable activities. The Smart Contract system in SafeMoon token development manages the overall operation of transactions without any delay,
  • The users can obtain a reward amount based on the volume of SafeMoon tokens traded in the marketplace. The efficient trading mechanism allows the users to trade the SafeMoon tokens at the best price for farming. The user can earn higher rewards based on the staking volume of tokens by users in the trade market.
  • It allows the token holders to gain complete ownership over their SafeMoon tokens after purchasing from DeFi exchanges. The SafeMoon community governs the token distribution, price fluctuations, staking, and every other token activity. The community boosts the value of SafeMoon tokens.
  • The Automated Burning tokens result in the community no longer having control over the SafeMoon tokens. Instead, the community can control the burn of the tokens efficiently for promoting its value in the marketplace. The transaction of SafeMoon tokens on the blockchain platform is fast, safe, and secure.

The SafeMoon Token Clone Development is a promising future for upcoming investors and startups to increase their business revenue in less time. The SafeMoon token clone has great demand in the real world among millions of users for its value in the market. Investors can contact leading Infinite Block Tech to gain proper assistance in developing a world-class SafeMoon token clone that increases the business growth in less time.

#safemoon token #safemoon token clone #safemoon token clone development #defi token

Angelina roda

Angelina roda

1624230000

How to Buy FEG Token - The EASIEST Method 2021. JUST IN A FEW MINUTES!!!

How to Buy FEG Token - The EASIEST Method 2021
In today’s video, I will be showing you guys how to buy the FEG token/coin using Trust Wallet and Pancakeswap. This will work for both iOS and Android devices!
📺 The video in this post was made by More LimSanity
The origin of the article: https://www.youtube.com/watch?v=LAVwpiEN6bg
🔺 DISCLAIMER: The article is for information sharing. The content of this video is solely the opinions of the speaker who is not a licensed financial advisor or registered investment advisor. Not investment advice or legal advice.
Cryptocurrency trading 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)!
☞ **-----CLICK HERE-----**⭐ ⭐ ⭐
Thanks for visiting and watching! Please don’t forget to leave a like, comment and share!

#bitcoin #blockchain #feg token #token #how to buy feg token #how to buy feg token - the easiest method 2021