twinkle942910 / checkmatefilter Goto Github PK
View Code? Open in Web Editor NEWSpellchecking and profanity filtering library
License: GNU General Public License v3.0
Spellchecking and profanity filtering library
License: GNU General Public License v3.0
Thanks.
I implemented this library in my android project. Unfortunately, running this line of code
val tx = TextFilter(Language.ENGLISH)
produces the following error:
java.lang.RuntimeException: Unable to start activity: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2946) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3081) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1831) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:201) at android.app.ActivityThread.main(ActivityThread.java:6810) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873) Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at java.util.ArrayList.get(ArrayList.java:437) at com.hankcs.algorithm.AhoCorasickDoubleArrayTrie$Builder.insert(AhoCorasickDoubleArrayTrie.java:828) at com.hankcs.algorithm.AhoCorasickDoubleArrayTrie$Builder.buildDoubleArrayTrie(AhoCorasickDoubleArrayTrie.java:791) at com.hankcs.algorithm.AhoCorasickDoubleArrayTrie$Builder.build(AhoCorasickDoubleArrayTrie.java:660) at com.hankcs.algorithm.AhoCorasickDoubleArrayTrie.build(AhoCorasickDoubleArrayTrie.java:411) at com.filter.textcorrector.profanity_filtering.dictionary.PlainDictionary.loadDictionary(PlainDictionary.java:65) at com.filter.textcorrector.profanity_filtering.dictionary.PlainDictionary.<init>(PlainDictionary.java:27) at com.filter.textcorrector.profanity_filtering.dictionary.EnglishDictionary.<init>(EnglishDictionary.java:7) at com.filter.textcorrector.profanity_filtering.dictionary.-$$Lambda$qtAl3-ipZ3A7V7-H7EhdcdW6_Ds.get(Unknown Source:2) at com.filter.textcorrector.profanity_filtering.dictionary.DictionaryFactory.create(DictionaryFactory.java:32) at com.filter.textcorrector.profanity_filtering.ProfanityFilter.<init>(ProfanityFilter.java:26) at com.filter.textcorrector.profanity_filtering.ProfanityFilter.<init>(ProfanityFilter.java:17) at com.filter.textcorrector.profanity_filtering.ProfanityFilter$Builder.build(ProfanityFilter.java:155) at com.filter.textcorrector.TextFilter.<init>(TextFilter.java:28) at com.filter.textcorrector.TextFilter.<init>(TextFilter.java:34) at [redacted].view.MainActivity.onCreate(MainActivity.kt:27)
Note: I used ProGuard and net.sourceforge.streamsupport:streamsupport:1.6.3 to retrofit the Java Streams Api required in this library
Hi! Trying to pass strings to my bukkit plugin with CheckMateFilter, however I'm getting the following error:
org.bukkit.event.EventException: null at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:308) ~[spigot.jar:git-Spigot-a1ba5fe-b4230a9] at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot.jar:git-Spigot-a1ba5fe-b4230a9] at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:500) ~[spigot.jar:git-Spigot-a1ba5fe-b4230a9] at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:485) ~[spigot.jar:git-Spigot-a1ba5fe-b4230a9] at net.minecraft.server.v1_13_R2.PlayerConnection.a(PlayerConnection.java:2389) ~[spigot.jar:git-Spigot-a1ba5fe-b4230a9] at net.minecraft.server.v1_13_R2.PacketPlayInUpdateSign.a(SourceFile:44) ~[spigot.jar:git-Spigot-a1ba5fe-b4230a9] at net.minecraft.server.v1_13_R2.PacketPlayInUpdateSign.a(SourceFile:10) ~[spigot.jar:git-Spigot-a1ba5fe-b4230a9] at net.minecraft.server.v1_13_R2.PlayerConnectionUtils.a(SourceFile:10) ~[spigot.jar:git-Spigot-a1ba5fe-b4230a9] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_161] at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_161] at net.minecraft.server.v1_13_R2.SystemUtils.a(SourceFile:199) [spigot.jar:git-Spigot-a1ba5fe-b4230a9] at net.minecraft.server.v1_13_R2.MinecraftServer.b(MinecraftServer.java:900) [spigot.jar:git-Spigot-a1ba5fe-b4230a9] at net.minecraft.server.v1_13_R2.DedicatedServer.b(DedicatedServer.java:417) [spigot.jar:git-Spigot-a1ba5fe-b4230a9] at net.minecraft.server.v1_13_R2.MinecraftServer.a(MinecraftServer.java:835) [spigot.jar:git-Spigot-a1ba5fe-b4230a9] at net.minecraft.server.v1_13_R2.MinecraftServer.run(MinecraftServer.java:733) [spigot.jar:git-Spigot-a1ba5fe-b4230a9] at java.lang.Thread.run(Unknown Source) [?:1.8.0_161] Caused by: java.lang.NoClassDefFoundError: it/unimi/dsi/fastutil/chars/Char2ObjectAVLTreeMap at com.filter.textcorrector.spellchecking.WordSuggester$Node.<init>(WordSuggester.java:349) ~[?:?] at com.filter.textcorrector.spellchecking.WordSuggester.<init>(WordSuggester.java:37) ~[?:?] at com.filter.textcorrector.spellchecking.dictionary.AbstractDictionary.loadDictionary(AbstractDictionary.java:55) ~[?:?] at com.filter.textcorrector.spellchecking.dictionary.AbstractDictionary.<init>(AbstractDictionary.java:29) ~[?:?] at com.filter.textcorrector.spellchecking.dictionary.EnglishDictionary.<init>(EnglishDictionary.java:7) ~[?:?] at com.filter.textcorrector.spellchecking.dictionary.DictionaryFactory.<clinit>(DictionaryFactory.java:17) ~[?:?] at com.filter.textcorrector.spellchecking.Spellchecker.<init>(Spellchecker.java:43) ~[?:?] at com.filter.textcorrector.spellchecking.Spellchecker$Builder.build(Spellchecker.java:369) ~[?:?] at com.filter.textcorrector.TextFilter.<init>(TextFilter.java:23) ~[?:?] at com.filter.textcorrector.TextFilter.<init>(TextFilter.java:34) ~[?:?] at me.craftblock.SignListener.onSignPlace(SignListener.kt:27) ~[?:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_161] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_161] at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:304) ~[spigot.jar:git-Spigot-a1ba5fe-b4230a9] ... 15 more Caused by: java.lang.ClassNotFoundException: it.unimi.dsi.fastutil.chars.Char2ObjectAVLTreeMap at java.net.URLClassLoader.findClass(Unknown Source) ~[?:1.8.0_161] at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:154) ~[spigot.jar:git-Spigot-a1ba5fe-b4230a9] at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:100) ~[spigot.jar:git-Spigot-a1ba5fe-b4230a9] at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_161] at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_161] at com.filter.textcorrector.spellchecking.WordSuggester$Node.<init>(WordSuggester.java:349) ~[?:?] at com.filter.textcorrector.spellchecking.WordSuggester.<init>(WordSuggester.java:37) ~[?:?] at com.filter.textcorrector.spellchecking.dictionary.AbstractDictionary.loadDictionary(AbstractDictionary.java:55) ~[?:?]
Here's how i'm installing the library:
<dependency> <groupId>com.filter.textcorrector</groupId> <artifactId>checkmate</artifactId> <version>1.0</version> </dependency>
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-install-plugin</artifactId> <version>2.5.2</version> <executions> <execution> <id>install-external</id> <phase>clean</phase> <configuration> <file>C:/dev/java/libs/CheckMateFilter/target/checkmate-1.0.jar</file> <repositoryLayout>default</repositoryLayout> <groupId>com.filter.textcorrector</groupId> <artifactId>checkmate</artifactId> <version>1.0</version> <packaging>jar</packaging> <generatePom>true</generatePom> </configuration> <goals> <goal>install-file</goal> </goals> </execution> </executions> </plugin>
What am I doing wrong?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.