<commit_before>Disclaimer

I am interested in testing technologies and the best way is to do it yourself and experiment. Just do what others did already is a way to learn. This is why I posting what I have done by myself without any pretending to invent or teach anything to anyone.

Happy to share with anyone, happy anyone takes a copy, but I would recommend not to use any of this material as it is more for personal experiment than to achieve anything special other than learning.

# Introduction

This section will present 5 uses cases to demonstrate the power of Groovy/Java integration and interaction

1. `myJruleengine1.java`

   Compare the execution time between java inline code and groovy parse/run code pattern of Groovy native script engine
   It will highlight the power and flexibility of embedding groovy script.
   part of this use case is as well to play with the groovy script without changing the java apps calling it.
   Binding concept are illustrated as well as decoupling the groovy parsing/compile from execution.
2. `myJruleengine2.java`

   Implement same as in previous point by using Java Scrit API instead of Groovy script engine.
   This use case highlights the difference between a full evaluation of the script at each iteration and the only one compilation then may execution.
3. `myJruleengine3.java`

   Depending on the flexibility of the scripting language, this example applies same as previous use case by replacing groovy with python. Interestingly the execution time between groovy and python can be noticed.
4. `myJruleengine4.java`

   This example extends the learning of example 1 here under by exploring better way of binding data between java and the script engine. Here is highlighted a smart way to bind a significant amount of data without the script having to take care of anything. The script just need to know the various objects that can be used in its own execution environment.
   A java object is bound to the script through an instanciation of the object coming from the java objects. Then the script can read and write to object at any time, making the interaction between the engine and java very convenient.
   
5. `myJruleengine1.groovy`<commit_msg>update doc<commit_after>Disclaimer

I am interested in testing technologies and the best way is to do it yourself and experiment. Just do what others did already is a way to learn. This is why I posting what I have done by myself without any pretending to invent or teach anything to anyone.

Happy to share with anyone, happy anyone takes a copy, but I would recommend not to use any of this material as it is more for personal experiment than to achieve anything special other than learning.

# Introduction

This section will present 5 uses cases to demonstrate the power of Groovy/Java integration and interaction

1. `myJruleengine1.java`

   Compare the execution time between java inline code and groovy parse/run code pattern of Groovy native script engine
   It will highlight the power and flexibility of embedding groovy script.
   part of this use case is as well to play with the groovy script without changing the java apps calling it.
   Binding concept are illustrated as well as decoupling the groovy parsing/compile from execution.
2. `myJruleengine2.java`

   Implement same as in previous point by using Java Scrit API instead of Groovy script engine.
   This use case highlights the difference between a full evaluation of the script at each iteration and the up front one off evaluation and the many subsequent execution of the same script evaluated only once.
   
3. `myJruleengine3.java`

   Depending on the flexibility of the scripting language, this example applies same as previous use case by replacing groovy with python. Interestingly the execution time between groovy and python can be noticed.
4. `myJruleengine4.java`

   This example extends the learning of example 1 here under by exploring better way of binding data between java and the script engine. Here is highlighted a smart way to bind a significant amount of data without the script having to take care of anything. The script just need to know the various objects that can be used in its own execution environment.
   A java object is bound to the script through an instanciation of the object coming from the java objects. Then the script can read and write to object at any time, making the interaction between the engine and java very convenient.
   
5. `myJruleengine1.groovy`
{'fraction_non_alphanumeric': 0.02093541202672606, 'fraction_numerical': 0.005345211581291759, 'mean_word_length': 4.228172293364377, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2968198', 'n_tokens_mistral': 1027, 'n_tokens_neox': 980, 'n_words': 715}