SlideShare une entreprise Scribd logo
1  sur  23
The NuGramDynamic Grammar Language Supported by NuGram 2.2 June 16th, 2010
Background Extension to W3C’s SRGS ABNF format Supported by a complete development environment –NuGram IDE Dynamic grammars are deployable on NuGram Server Copyright © 2010 Nu Echo Inc.
Expressions Constants null, false, true StringsEx: “abc”, “John Smith”, “05/30/2010” NumbersEx: 10, 325.64 Variables Must be a legal Java identifier Top-level variables are provided by the instantiation context Copyright © 2010 Nu Echo Inc.
Expressions Properties Syntax: obj.propertyName Property name must be a valid Java identifier Method calls Syntax: obj.methodName(arguments…) Arguments are comma-separate Array elements Syntax: obj[indexValue] Copyright © 2010 Nu Echo Inc.
Expressions Comparison operators ==  != Logical operators ! (negation) && (conjunction) || (disjunction) Copyright © 2010 Nu Echo Inc.
Dynamic Words Syntax@word ( Expressions… ) Values of all expressions are concatenated Example Copyright © 2010 Nu Echo Inc.
Dynamic Rule References Syntax@ref ( Expressions… ) Values of all expressions are concatenated Resulting value must start with “#” for a local rule reference Example Copyright © 2010 Nu Echo Inc.
Dynamic Tags Syntax@tag ( Expressions… ) Values of all expressions are concatenated  Example Copyright © 2010 Nu Echo Inc.
Iterations Syntax@for ( var: Expression )    Expansions…@end Repeats the expansions for each value in the collection resulting from evaluating Expression. Copyright © 2010 Nu Echo Inc.
Iterations Example Copyright © 2010 Nu Echo Inc.
Dynamic Sequences Syntax@seqExpansions… @end All direct expansions become part of the sequence Copyright © 2010 Nu Echo Inc.
Dynamic sequences Example Copyright © 2010 Nu Echo Inc.
Dynamic Choices Syntax@altExpansions… @end All direct expansions become alternative choices Copyright © 2010 Nu Echo Inc.
Dynamic Choices Example 1 Copyright © 2010 Nu Echo Inc.
Example 2 Beware: @alt and @for may produce unexpected results Dynamic Choices Copyright © 2010 Nu Echo Inc.
Example 2 (cont'd) Solution: use grouping Dynamic Choices Copyright © 2010 Nu Echo Inc.
Local Variable Definitions Syntax@varIdent = Expression :Expansions… @end Ident is visible for the Expansions Multiple variables can be declared at once Example@varfirstname = name.firstname,lastname = name.lastname :   ( [@wordlastname]     [@wordfirstname] @wordlastname )@end Copyright © 2010 Nu Echo Inc.
Conditionals Syntax@if ( Expression )Expansions… @elseif ( Expression )Expansions… @elseExpansions… @end A single branch of the conditional is executed @elseifand @else branches are optional There can be more than one @elseif, but a single @else Copyright © 2010 Nu Echo Inc.
Macros Definitions Syntax@defineIdent (Parameters):Expansions… @end Parameters are comma-separated identifiers Can only appear as a top-level form Example@define fullname (name) :  [@word name.firstname] @word name.lastname@end Copyright © 2010 Nu Echo Inc.
Macros Invocations Syntax@callIdent (Expressions…) Arguments are comma-separated Example@for (name : names)  @call fullname (name)@end Copyright © 2010 Nu Echo Inc.
Dynamic Rules Syntax@ruleExpression = Expansions… @end All direct expansions become alternative choices Especially useful inside a top-level @for Example@for (typeSet : addresses.getStreetTypes())@rule typeSet.getUniqueId() =@call streetTypes(typeSet)@end@end Copyright © 2010 Nu Echo Inc.
Dynamic Headers Syntaxmode @stringExpression;root @stringExpression;language @stringExpression;lexicon @stringExpression;meta “string” is @stringExpression;tag-format @stringExpression; Expression must evaluate to a string Useful for engine-specific headers Copyright © 2010 Nu Echo Inc.
Conditional Headers Syntax Add a @when clause at the end of the header form Examplelexicon <mylexicon.xml> @when engine == “osr”;tag-format <swi-semantics/1.0> @when engine == “osr”;meta “com.nuecho.generation.omit-tags” is “true” @when engine != “osr”; Copyright © 2010 Nu Echo Inc.

Contenu connexe

Tendances

Introduction of tango! (en)
Introduction of tango! (en)Introduction of tango! (en)
Introduction of tango! (en)
Yohei Yasukawa
 
Coding Standards & Best Practices for iOS/C#
Coding Standards & Best Practices for iOS/C#Coding Standards & Best Practices for iOS/C#
Coding Standards & Best Practices for iOS/C#
Asim Rais Siddiqui
 
Week4142
Week4142Week4142
Week4142
H K
 

Tendances (20)

Fundamental Unicode in Perl
Fundamental Unicode in PerlFundamental Unicode in Perl
Fundamental Unicode in Perl
 
Mca ii dfs u-2 array records and pointer
Mca ii dfs u-2 array records and pointerMca ii dfs u-2 array records and pointer
Mca ii dfs u-2 array records and pointer
 
Categorizing and pos tagging with nltk python
Categorizing and pos tagging with nltk pythonCategorizing and pos tagging with nltk python
Categorizing and pos tagging with nltk python
 
Wiki-syntax for Description Set Profile
Wiki-syntax for Description Set ProfileWiki-syntax for Description Set Profile
Wiki-syntax for Description Set Profile
 
JavaScript Missing Manual, Ch. 2
JavaScript Missing Manual, Ch. 2JavaScript Missing Manual, Ch. 2
JavaScript Missing Manual, Ch. 2
 
Introduction of tango! (en)
Introduction of tango! (en)Introduction of tango! (en)
Introduction of tango! (en)
 
introduction to python
 introduction to python introduction to python
introduction to python
 
Was können wir von Rebol lernen?
Was können wir von Rebol lernen?Was können wir von Rebol lernen?
Was können wir von Rebol lernen?
 
Meta Languages Railroad Diagrams
Meta Languages Railroad DiagramsMeta Languages Railroad Diagrams
Meta Languages Railroad Diagrams
 
Get started python programming part 1
Get started python programming   part 1Get started python programming   part 1
Get started python programming part 1
 
Beginning text analysis
Beginning text analysisBeginning text analysis
Beginning text analysis
 
Coding Standards & Best Practices for iOS/C#
Coding Standards & Best Practices for iOS/C#Coding Standards & Best Practices for iOS/C#
Coding Standards & Best Practices for iOS/C#
 
Python Tutorial
Python TutorialPython Tutorial
Python Tutorial
 
Week4142
Week4142Week4142
Week4142
 
Zend framework 06 - zend config, pdf, i18n, l10n, sessions
Zend framework 06 - zend config, pdf, i18n, l10n, sessionsZend framework 06 - zend config, pdf, i18n, l10n, sessions
Zend framework 06 - zend config, pdf, i18n, l10n, sessions
 
Huffman tree coding
Huffman tree codingHuffman tree coding
Huffman tree coding
 
About XML
About XMLAbout XML
About XML
 
Understanding Python
Understanding PythonUnderstanding Python
Understanding Python
 
In-Depth Guide On WordPress Coding Standards For PHP & HTML
In-Depth Guide On WordPress Coding Standards For PHP & HTMLIn-Depth Guide On WordPress Coding Standards For PHP & HTML
In-Depth Guide On WordPress Coding Standards For PHP & HTML
 
Python - Lesson 1
Python - Lesson 1Python - Lesson 1
Python - Lesson 1
 

Similaire à The NuGram dynamic grammar language

Android coding guide lines
Android coding guide linesAndroid coding guide lines
Android coding guide lines
lokeshG38
 
Coding standards for java
Coding standards for javaCoding standards for java
Coding standards for java
maheshm1206
 

Similaire à The NuGram dynamic grammar language (20)

NetBase API Presentation
NetBase API PresentationNetBase API Presentation
NetBase API Presentation
 
The NuGram approach to dynamic grammars
The NuGram approach to dynamic grammarsThe NuGram approach to dynamic grammars
The NuGram approach to dynamic grammars
 
Android coding guide lines
Android coding guide linesAndroid coding guide lines
Android coding guide lines
 
Java 5 PSM for DDS: Revised Submission (out of date)
Java 5 PSM for DDS: Revised Submission (out of date)Java 5 PSM for DDS: Revised Submission (out of date)
Java 5 PSM for DDS: Revised Submission (out of date)
 
Introduction to JVM languages and Fantom (very brief)
Introduction to JVM languages and Fantom (very brief)Introduction to JVM languages and Fantom (very brief)
Introduction to JVM languages and Fantom (very brief)
 
Introduction to Core Java Programming
Introduction to Core Java ProgrammingIntroduction to Core Java Programming
Introduction to Core Java Programming
 
Interpreter
InterpreterInterpreter
Interpreter
 
Learn C# programming - Interfaces & Namespaces
Learn C# programming - Interfaces & NamespacesLearn C# programming - Interfaces & Namespaces
Learn C# programming - Interfaces & Namespaces
 
Coding standards for java
Coding standards for javaCoding standards for java
Coding standards for java
 
JavaScript.pptx
JavaScript.pptxJavaScript.pptx
JavaScript.pptx
 
Lecture2_MCS4_Evening.pptx
Lecture2_MCS4_Evening.pptxLecture2_MCS4_Evening.pptx
Lecture2_MCS4_Evening.pptx
 
Namespace.pdf
Namespace.pdfNamespace.pdf
Namespace.pdf
 
iOS Application Development
iOS Application DevelopmentiOS Application Development
iOS Application Development
 
International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)
 
International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)
 
Python Programming Basics for begginners
Python Programming Basics for begginnersPython Programming Basics for begginners
Python Programming Basics for begginners
 
Twitter Author Prediction from Tweets using Bayesian Network
Twitter Author Prediction from Tweets using Bayesian NetworkTwitter Author Prediction from Tweets using Bayesian Network
Twitter Author Prediction from Tweets using Bayesian Network
 
Md03 - part3
Md03 - part3Md03 - part3
Md03 - part3
 
Android coding standard
Android coding standard Android coding standard
Android coding standard
 
Java
JavaJava
Java
 

Dernier

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Dernier (20)

DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 

The NuGram dynamic grammar language

  • 1. The NuGramDynamic Grammar Language Supported by NuGram 2.2 June 16th, 2010
  • 2. Background Extension to W3C’s SRGS ABNF format Supported by a complete development environment –NuGram IDE Dynamic grammars are deployable on NuGram Server Copyright © 2010 Nu Echo Inc.
  • 3. Expressions Constants null, false, true StringsEx: “abc”, “John Smith”, “05/30/2010” NumbersEx: 10, 325.64 Variables Must be a legal Java identifier Top-level variables are provided by the instantiation context Copyright © 2010 Nu Echo Inc.
  • 4. Expressions Properties Syntax: obj.propertyName Property name must be a valid Java identifier Method calls Syntax: obj.methodName(arguments…) Arguments are comma-separate Array elements Syntax: obj[indexValue] Copyright © 2010 Nu Echo Inc.
  • 5. Expressions Comparison operators == != Logical operators ! (negation) && (conjunction) || (disjunction) Copyright © 2010 Nu Echo Inc.
  • 6. Dynamic Words Syntax@word ( Expressions… ) Values of all expressions are concatenated Example Copyright © 2010 Nu Echo Inc.
  • 7. Dynamic Rule References Syntax@ref ( Expressions… ) Values of all expressions are concatenated Resulting value must start with “#” for a local rule reference Example Copyright © 2010 Nu Echo Inc.
  • 8. Dynamic Tags Syntax@tag ( Expressions… ) Values of all expressions are concatenated Example Copyright © 2010 Nu Echo Inc.
  • 9. Iterations Syntax@for ( var: Expression ) Expansions…@end Repeats the expansions for each value in the collection resulting from evaluating Expression. Copyright © 2010 Nu Echo Inc.
  • 10. Iterations Example Copyright © 2010 Nu Echo Inc.
  • 11. Dynamic Sequences Syntax@seqExpansions… @end All direct expansions become part of the sequence Copyright © 2010 Nu Echo Inc.
  • 12. Dynamic sequences Example Copyright © 2010 Nu Echo Inc.
  • 13. Dynamic Choices Syntax@altExpansions… @end All direct expansions become alternative choices Copyright © 2010 Nu Echo Inc.
  • 14. Dynamic Choices Example 1 Copyright © 2010 Nu Echo Inc.
  • 15. Example 2 Beware: @alt and @for may produce unexpected results Dynamic Choices Copyright © 2010 Nu Echo Inc.
  • 16. Example 2 (cont'd) Solution: use grouping Dynamic Choices Copyright © 2010 Nu Echo Inc.
  • 17. Local Variable Definitions Syntax@varIdent = Expression :Expansions… @end Ident is visible for the Expansions Multiple variables can be declared at once Example@varfirstname = name.firstname,lastname = name.lastname : ( [@wordlastname] [@wordfirstname] @wordlastname )@end Copyright © 2010 Nu Echo Inc.
  • 18. Conditionals Syntax@if ( Expression )Expansions… @elseif ( Expression )Expansions… @elseExpansions… @end A single branch of the conditional is executed @elseifand @else branches are optional There can be more than one @elseif, but a single @else Copyright © 2010 Nu Echo Inc.
  • 19. Macros Definitions Syntax@defineIdent (Parameters):Expansions… @end Parameters are comma-separated identifiers Can only appear as a top-level form Example@define fullname (name) : [@word name.firstname] @word name.lastname@end Copyright © 2010 Nu Echo Inc.
  • 20. Macros Invocations Syntax@callIdent (Expressions…) Arguments are comma-separated Example@for (name : names) @call fullname (name)@end Copyright © 2010 Nu Echo Inc.
  • 21. Dynamic Rules Syntax@ruleExpression = Expansions… @end All direct expansions become alternative choices Especially useful inside a top-level @for Example@for (typeSet : addresses.getStreetTypes())@rule typeSet.getUniqueId() =@call streetTypes(typeSet)@end@end Copyright © 2010 Nu Echo Inc.
  • 22. Dynamic Headers Syntaxmode @stringExpression;root @stringExpression;language @stringExpression;lexicon @stringExpression;meta “string” is @stringExpression;tag-format @stringExpression; Expression must evaluate to a string Useful for engine-specific headers Copyright © 2010 Nu Echo Inc.
  • 23. Conditional Headers Syntax Add a @when clause at the end of the header form Examplelexicon <mylexicon.xml> @when engine == “osr”;tag-format <swi-semantics/1.0> @when engine == “osr”;meta “com.nuecho.generation.omit-tags” is “true” @when engine != “osr”; Copyright © 2010 Nu Echo Inc.