mirror of
https://github.com/boostorg/website-v2-docs.git
synced 2026-01-19 04:42:17 +00:00
Diagrams added to four more User Guide scenarios (#485)
This commit is contained in:
BIN
user-guide/modules/ROOT/images/natural-language-parsing.png
Normal file
BIN
user-guide/modules/ROOT/images/natural-language-parsing.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
BIN
user-guide/modules/ROOT/images/quantum-walk-simulation.png
Normal file
BIN
user-guide/modules/ROOT/images/quantum-walk-simulation.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 604 KiB |
BIN
user-guide/modules/ROOT/images/system-timing.png
Normal file
BIN
user-guide/modules/ROOT/images/system-timing.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 692 KiB |
BIN
user-guide/modules/ROOT/images/template-time-machine.png
Normal file
BIN
user-guide/modules/ROOT/images/template-time-machine.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 696 KiB |
@@ -285,7 +285,9 @@ boost:hana[] adds efficient tuple handling at runtime (for example, easier acces
|
||||
| Better Compile-Time Speed | Yes | No, Slower
|
||||
|===
|
||||
|
||||
Let's update our sample to include _tag dispatching_, so each type is classified at compile time, and _runtime tuple processing_, so the sample iterates over heterogeneous types at runtime.
|
||||
Let's update our sample to include _tag dispatching_, so each type is classified at compile time, and _runtime tuple processing_, so the sample iterates over heterogeneous types at runtime. Not having all metaprogramming processes occur at the same time does add a level to your program complexity!
|
||||
|
||||
image::template-time-machine.png[]
|
||||
|
||||
[source,cpp]
|
||||
----
|
||||
|
||||
@@ -19,6 +19,7 @@ Natural language processing is a complex field that goes beyond just programming
|
||||
* <<Simple English Parsing Sample>>
|
||||
* <<Add a Dictionary of Valid Words>>
|
||||
* <<Add Detailed Error Reporting>>
|
||||
* <<Next Steps>>
|
||||
* <<See Also>>
|
||||
|
||||
== Libraries
|
||||
@@ -410,12 +411,20 @@ The sentence must be of the form:
|
||||
Noun 2: - invalid
|
||||
----
|
||||
|
||||
== Next Steps
|
||||
|
||||
You will notice how adding more features to a natural language parser starts to considerably increase the code length. This is a normal feature of language parsing - a lot of code can be required to cover all the options of something as flexible as language. For an example of a simpler approach to parsing _well-formatted_ input, refer to the sample code in xref:task-text-processing.adoc[].
|
||||
|
||||
When designing a natural language system, it is good practice to divide the process into three main steps: *syntax analysis* (parsing), *semantic analysis* (grammar), and *interpretation*. Even though it might be possible to combine some grammar checking with the syntax checking, it is often better practice not to do this but complete the syntax checking first - this makes for greater maintainability and comprehension as the code is developed over time. The final stage, interpretation, usually depends on context. In the following sequence, a phrase as simple as "time flies" contains ambiguity:
|
||||
|
||||
image::natural-language-parsing.png[]
|
||||
|
||||
The phrase is so widely known it obscures the interpretation of "flies" as a noun. Context is required during interpretation to treat the input as a phrase, and not as something of the form "horse flies". Natural language parsers can remind us of ambiguity when at first we don't see it!
|
||||
|
||||
|
||||
== See Also
|
||||
|
||||
* https://www.boost.org/doc/libs/latest/libs/libraries.htm#Parsing[Category: Parsing]
|
||||
* https://www.boost.org/doc/libs/latest/libs/libraries.htm#Patterns[Category: Patterns and Idioms]
|
||||
* https://www.boost.org/doc/libs/latest/libs/libraries.htm#String[Category: String and text processing]
|
||||
|
||||
|
||||
|
||||
@@ -520,6 +520,8 @@ If you run this code you will get something like:
|
||||
|
||||
Again, the result shows the probability distribution of being at any one of the positions at the end of the 2D walk.
|
||||
|
||||
image::quantum-walk-simulation.png[]
|
||||
|
||||
|
||||
=== Other Quantum Algorithms
|
||||
|
||||
|
||||
@@ -267,6 +267,8 @@ The following command lines show how to run with defaults, run with options spec
|
||||
|
||||
It might be important to record the time taken for system operations, both in testing and in the operation of a system app. So, let's integrate boost:chrono[] to measure the time taken for key filesystem operations, such as creating directories, writing to files, reading files, and deleting files.
|
||||
|
||||
image::system-timing.png[]
|
||||
|
||||
[source,cpp]
|
||||
----
|
||||
#include <boost/filesystem.hpp>
|
||||
@@ -395,9 +397,7 @@ int main(int argc, char* argv[]) {
|
||||
|
||||
----
|
||||
|
||||
Note:: The code measures operation execution time in microseconds.
|
||||
|
||||
The following is example output from running the sample.
|
||||
The following is example output from running the sample:
|
||||
|
||||
[source,text]
|
||||
----
|
||||
|
||||
Reference in New Issue
Block a user