kandi background
Explore Kits

rivescript-java | RiveScript interpreter | Chat library

 by   aichaos Java Version: v0.11.0 License: MIT

 by   aichaos Java Version: v0.11.0 License: MIT

Download this library from

kandi X-RAY | rivescript-java Summary

rivescript-java is a Java library typically used in Messaging, Chat applications. rivescript-java has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has low support. You can download it from GitHub, Maven.
This is a RiveScript interpreter library written for the Java programming language. RiveScript is a scripting language for chatterbots, making it easy to write trigger/response pairs for building up a bot's intelligence.
Support
Support
Quality
Quality
Security
Security
License
License
Reuse
Reuse

kandi-support Support

  • rivescript-java has a low active ecosystem.
  • It has 60 star(s) with 35 fork(s). There are 12 watchers for this library.
  • It had no major release in the last 12 months.
  • There are 12 open issues and 33 have been closed. On average issues are closed in 44 days. There are 1 open pull requests and 0 closed requests.
  • It has a neutral sentiment in the developer community.
  • The latest version of rivescript-java is v0.11.0
rivescript-java Support
Best in #Chat
Average in #Chat
rivescript-java Support
Best in #Chat
Average in #Chat

quality kandi Quality

  • rivescript-java has 0 bugs and 0 code smells.
rivescript-java Quality
Best in #Chat
Average in #Chat
rivescript-java Quality
Best in #Chat
Average in #Chat

securitySecurity

  • rivescript-java has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
  • rivescript-java code analysis shows 0 unresolved vulnerabilities.
  • There are 0 security hotspots that need review.
rivescript-java Security
Best in #Chat
Average in #Chat
rivescript-java Security
Best in #Chat
Average in #Chat

license License

  • rivescript-java is licensed under the MIT License. This license is Permissive.
  • Permissive licenses have the least restrictions, and you can use them in most projects.
rivescript-java License
Best in #Chat
Average in #Chat
rivescript-java License
Best in #Chat
Average in #Chat

buildReuse

  • rivescript-java releases are available to install and integrate.
  • Deployable package is available in Maven.
  • Build file is available. You can build the component from source.
  • Installation instructions, examples and code snippets are available.
  • It has 6423 lines of code, 511 functions and 85 files.
  • It has medium code complexity. Code complexity directly impacts maintainability of the code.
rivescript-java Reuse
Best in #Chat
Average in #Chat
rivescript-java Reuse
Best in #Chat
Average in #Chat
Top functions reviewed by kandi - BETA

kandi has reviewed rivescript-java and discovered the below as its top functions. This is intended to give you an instant insight into rivescript-java implemented functionality, and help decide if they suit your requirements.

  • Parses the given code and returns the parse tree .
  • Gets a reply for a user .
  • Run the main loop .
  • Invokes the function .
  • Counts the number of words in the string .
  • Entry point .
  • Compares this topic with the specified object .
  • Clone user data .
  • Returns the reverse message .
  • Returns a hashCode of this object .

rivescript-java Key Features

A RiveScript interpreter for Java. RiveScript is a scripting language for chatterbots.

About RiveScript

copy iconCopydownload iconDownload
+ hello bot
- Hello human.

Installation

copy iconCopydownload iconDownload
<dependency>
  <groupId>com.rivescript</groupId>
  <artifactId>rivescript-core</artifactId>
  <version>0.10.0</version>
</dependency>

Usage

copy iconCopydownload iconDownload
import com.rivescript.Config;
import com.rivescript.RiveScript;

// Create a new bot with the default settings.
RiveScript bot = new RiveScript();

// To enable UTF-8 mode, you'd have initialized the bot like:
RiveScript bot = new RiveScript(Config.utf8());

// Load a directory full of RiveScript documents (.rive files)
bot.loadDirectory("./replies");

// Load an individual file.
bot.LoadFile("./testsuite.rive");

// Sort the replies after loading them!
bot.sortReplies();

// Get a reply.
String reply = bot.reply("user", "Hello bot!");

Configuration

copy iconCopydownload iconDownload
RiveScript bot = new RiveScript(Config.newBuilder()
        .throwExceptions(false)          // Whether exception throwing is enabled
        .strict(true)                    // Whether strict syntax checking is enabled
        .utf8(false)                     // Whether UTF-8 mode is enabled
        .unicodePunctuation("[.,!?;:]")  // The unicode punctuation pattern
        .forceCase(false)                // Whether forcing triggers to lowercase is enabled
        .concat(ConcatMode.NONE)         // The concat mode
        .depth(50)                       // The recursion depth limit 
        .sessionManager(sessionManager)  // The session manager for user variables
        .errorMessages(errors)           // Map of custom error messages
        .build());

UTF-8 Support

copy iconCopydownload iconDownload
// Make a new bot with UTF-8 mode enabled and override the punctuation
characters that get stripped from the user's message.
RiveScript bot = new RiveScript(Config.Builder
        .utf8()
        .unicodePunctuation("[.,!?;:]")
        .build());

Spring Boot Starter

copy iconCopydownload iconDownload
<dependency>
  <groupId>com.rivescript</groupId>
  <artifactId>rivescript-spring-boot-starter</artifactId>
  <version>0.10.0</version>
</dependency>

Building

copy iconCopydownload iconDownload
./gradlew build

Samples

copy iconCopydownload iconDownload
/quit        - Quit the program
/dump topics - Dump the internal topic/trigger/reply struct (debugging)
/dump sorted - Dump the internal trigger sort buffers (debugging)
/last        - Print the last trigger you matched.

License

copy iconCopydownload iconDownload
The MIT License (MIT)

Copyright (c) 2016 the original author or authors.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Community Discussions

Trending Discussions on Chat
  • react-native-gifted-chat How to send on pressing return
  • Mongodb Mongoose sort and paginate chat messages
  • Testproject Messager with Flutter using Peer-to-Peer Technology
  • How does the disconnect event works in socket.io?
  • Perform action on seen/unseen messages with socket.io
  • Ngfor doesn't actualize on reloading page (Angular + RXJS)
  • BrokenPipeError on socket
  • How to handle thousands of messages in a real-time group chat with Firestore?
  • How to get information from a client socket and display information on a server?
  • all messages time stamps keep updating to current time when a message is sent
Trending Discussions on Chat

QUESTION

react-native-gifted-chat How to send on pressing return

Asked 2022-Feb-21 at 11:33

How do I make the return button on the mobile keyboard send the message instead of creating a new line? I tried using onSubmitEditing in the textInputProps but couldn't get it to work.

ANSWER

Answered 2022-Feb-21 at 11:33

You need to implement your own ChatComposer and pass the onSubmitEditing prop in the textInputProps in there. In order to prevent keyboard dismiss you also need to set blurOnSubmit to false.

const [messages, setMessages] = useState([])


const onSend = useCallback((messages = []) => {
    setMessages((previousMessages) => GiftedChat.append(previousMessages, messages))
}, [])

const ChatComposer = (
    props: ComposerProps & {
      onSend: SendProps<IMessage>["onSend"]
      text: SendProps<IMessage>["text"]
    }
) => {
    return (
      <Composer
        {...props}
        textInputProps={{
          ...props.textInputProps,
          blurOnSubmit: false,
          multiline: false,
          onSubmitEditing: () => {
            if (props.text && props.onSend) {
              props.onSend({ text: props.text.trim() }, true)
            }
          },
        }}
      />
    )
 }

return (
    <GiftedChat messages={messages} onSend={onSend} renderComposer={ChatComposer} />
  )

If you want to remove the default send button from the text input field on the right, you need to pass a custom renderSend button, which could be empty, e.g.

renderSend={() => {}}

Notice, that I have tested all of the above on iOS only. Android might behave differently.

Source https://stackoverflow.com/questions/71203028

Community Discussions, Code Snippets contain sources that include Stack Exchange Network

Vulnerabilities

No vulnerabilities reported

Install rivescript-java

Add the rivescript-core dependency to your project:. If you want to use RiveScript in a Spring Boot application see the Spring Boot Starter section.

Support

Also check out the RiveScript Community Wiki for common design patterns and tips & tricks for RiveScript.

DOWNLOAD this Library from

Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

  • © 2022 Open Weaver Inc.