Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
io.github.iquote:text-processing
One of the major changes here (except for some code style change and saying bye-bye to Mr. StringBuffer
)
is the "unstatic'ing" of the DetectorFactory
class. Now it has to be created via consructor that accepts
a single parameter shortMessages
that defines which corpus should be used:
true
then language profiles that are generated from Twitter Corpus are used. These language profiles should prove better on short messagesfalse
then language profiles that are generated from Wikipedia Corpus are used. These language profiles should prove better on long messagesCorpuses are now part of the language detection JAR file. Also please note that Detector
instances obtained from
the DetectorFactory
are stateful - they keep both evaluated text as well as some additional information inside.
// Use short message corpus
final DetectorFactory detectorFactory = new DetectorFactory(true);
final Detector detector = detectorFactory.create();
detector.append("Some text to detect language for");
final String detectedLang = detector.detect();
Set of various tools for performing text analysis
Utilizes Language detector and Apache Lucene for term extraction from an arbitrary string.
Since TermExtractionService
uses the DetectorFactory
it also asks for a shortMessages
parameter when constructing
an instance. Example usage can be found below:
// Use short message corpus
final TermExtractionService service = new TermExtractionService(true);
final List<String> terms = service.getTerms("Some text to extract terms from");
Can be used both to remove some of the unwanted chars from the given text and extract Twitter-like entities: hashtags, cashtags, mentions and urls. Example usage:
// Remove characters that are responsible for the text direction or
// are invisible spaces that may interfere
final TextCleanupService service = new TextCleanupService();
final String cleanedUp = service.removeDirectionAndInvisibleChars("Some text with garbage here");
// Remove Twitter-like entities from text. If second parameter is set to true
// removeDirectionAndInvisibleChars() will be invoked before the entity cleanup
final String withoutEntities = service.removeTwitterEntities("@kgusarov Click me! #coolbuttons", true);
// It is also possible to get all the extracted entities with the cleaned up text
final Pair<String, List<Extractor.Entity>> withAndWithoutEntities = service.extractTwitterEntities("@kgusarov Click me! #coolbuttons", true);
Utilizes ICU4J for performing text transliteration. The service itself uses
Commons Pool for pooling Transliterator
instances. Example usage:
// Create service instance with given pool and transliterator configuration
final GenericObjectPoolConfig poolConfig = new GenericObjectPoolConfig();
poolConfig.setMaxIdle(4);
poolConfig.setMaxTotal(4);
poolConfig.setMinIdle(4);
final TransliterationService transliterationService =
new TransliterationService("Any-Lower; SomeExampleReplacement; Any-Latin; NFD; [^\\p{Alnum}] Remove", poolConfig);
transliterationService.addTransliteratorConfiguration("SomeExampleReplacement", "ы > i;");
final String transliterated = transliterate("Мама мыла раму");
Performs text analysis by utilizing other service found in this module. It accepts those services as a constructor arguments and uses them to perform all the neccessary actions.
final TransliterationService ts = TransliterationServiceFactory.create();
final TermExtractionService tes = new TermExtractionService(true);
final TextCleanupService tcs = new TextCleanupService();
final TextAnalysisService service = new TextAnalysisService(tes, tcs, ts);
final AnalysedText analysedText = service.analyse("Text to analyse", true);
Michael McCandless and his awesome language detection test that I've honestly have used.
Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
FAQs
This is a language detection library implemented in plain Java.
We found that io.github.iquote:text-processing demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.