Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
FarsiProcessor is a ruby gem to normalize and stem Persian/Farsi text
Normalization is defined as:
Stemming is defined as removing these suffixes (+ suffixes of plural form)
Add this line to your application's Gemfile:
gem "farsi_processor"
And then execute:
$ bundle
Or install it yourself as:
$ gem install farsi_processor
require 'farsi_processor'
[1] pry(main)> FarsiProcessor.process("ك")
=> "ک"
[2] pry(main)> FarsiProcessor.process("کتاب ها")
=> "کتاب"
# it supports only and except options
[3] pry(main)> FarsiProcessor.process("ك ي", only: ["ك"])
=> "ک ي"
[4] pry(main)> FarsiProcessor.process("ك ي", except: ["ك"])
=> "ك ی"
[5] pry(main)> FarsiProcessor.process('دخترهای', except: ['های'])
=> "دختره"
# you can choose to just normalize or stem a word,
# they also support an only and except option
[6] pry(main)> FarsiProcessor.normalize("ك")
=> "ک"
[7] pry(main)> FarsiProcessor.stem("کتاب ها")
=> "کتاب"
If you have any issues with farsi_processor which you cannot find the solution, please add an issue on GitHub or fork the project and send a pull request.
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that farsi_processor demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.