OpenLLM-France/wikimedia huggingface dataset:
# Chess Opening Theory/1. e4/1...e5/2. Nf3/2...Nc6/3. Bb5/3...f5/4. Nc3/4...fxe4/5. Nxe4/5...d5/6. Nxe5/6...dxe4/7. Nxc6/7...Qg5/8. Qe2/8...Nf6/9. Nxa7/9...Bd7/10. Bxd7/10...Nxd7

| | a | b | c | d | e | f | g | h | |
| 8 | | | | | | | | | 8 |
| 7 | | | | | | | | | 7 |
| 6 | | | | | | | | | 6 |
| 5 | | | | | | | | | 5 |
| 4 | | | | | | | | | 4 |
| 3 | | | | | | | | | 3 |
| 2 | | | | | | | | | 2 |
| 1 | | | | | | | | | 1 |
| | a | b | c | d | e | f | g | h | |
* 11. f4 is the line adopted by all the top players who have had this variation as White, including Peter Svidler. As in the 9.f4 variation, White is defending g2 horizontally and hitting the Black queen, but now the circumstances are different: without the knight on c6, Black won't be obliged to chop f4 off simply to prevent the knight retreating to e5, and if she prefers to grab the c-pawn instead she can do that with 11...Qc5 (9.f4 Qc5? would have run into 10.d4 when everything is defended).
* 11. Nb5 allows 11...Qxg2 12.Qf1 Qxf1+ 13.Kxf1 O-O-O or 12.Rf1 O-O-O when Black's greater mobility compensates for the pawn.
* 11. Qxe4? wins a pawn but loses a piece, because it gives up control of the b5 square that the knight needs to retreat to. 11...Kd8 and now:
** 12.Qd4 and 12.Qe3 lose to 12...Bc5
** 12.Qa4 loses to 12...Nb6
** 12.Qxb7 Rxa7! and the rook is immune because 13.Qxa7 Qg2 picks up the h1-rook (14.Rf1 Bc5 with ...Re8+ to follow makes things even worse).
Fun fact: those three moves in descending order of strength offer a pawn, preserve the material balance, and capture a pawn. Collecting pawns in the opening is overrated!
# Chess Opening Theory/1. e4/1...e5/2. Nf3/2...Nc6/3. Bb5/3...f5/4. Nc3/4...fxe4/5. Nxe4/5...d5/6. Nxe5/6...dxe4/7. Nxc6/7...Qd5/8. c4/8...Qd6/9. Qh5/9...g6

| | a | b | c | d | e | f | g | h | |
| 8 | | | | | | | | | 8 |
| 7 | | | | | | | | | 7 |
| 6 | | | | | | | | | 6 |
| 5 | | | | | | | | | 5 |
| 4 | | | | | | | | | 4 |
| 3 | | | | | | | | | 3 |
| 2 | | | | | | | | | 2 |
| 1 | | | | | | | | | 1 |
| | a | b | c | d | e | f | g | h | |
The usual move here is
* 10. Qe5+, when after the forcing sequence 10...Qxe5 11.Nxe5+ c6 12.Ba4 Bg7 13.d4 exd3 White can simply recapture with
** 14.Nxd3 and try to untangle her queenside and convert the extra pawn, or alternatively:
** 14.O-O (to meet ...Bxe5 with Re1 winning the bishop pair) and then 14...Bxe5 15.Re1 is simple enough, but with either 14...Be6 or 14...Bf5 Black can challenge White to the very very long variation:
*** 15.Nxc6 Bd7 16.Re1+ Kf8 17.Nd4! Bxa4 18.Ne6+ Kf7 19.Nxg7 Kxg7 20.b3 Be8 21.Bb2+ Nf6 22.Re7+ Bf7 23.g4 g5 24.f4 gxf4 25.g5 and White has at last won the piece back with, well, approximately a drawn position.
*** 15.Re1 is probably the sane option.
* 10. Nxa7+ offers to transpose to the 9.Nxa7+ lines, which Black can accept with 10...Bd7 11.Bxd7 Qxd7 12.Qe5+. Since those lines are mostly terrible, Black may be objectively better off with 10...c6, leading to 11.Nxc8 and then either 11...gxh5 12.Nxd6+ Bxd6 or 11...Rxc8 12.Qh3 Ra8, neither of which have been tested by theory.
# Chess Opening Theory/1. e4/1...e5/2. Nf3/2...Nc6/3. Bb5/3...f5/4. Nc3/4...fxe4/5. Nxe4/5...d5/6. Nxe5/6...dxe4/7. Nxc6/7...Qg5/8. Qe2/8...Nf6/9. Nxa7/9...Bd7

| | a | b | c | d | e | f | g | h | |
| 8 | | | | | | | | | 8 |
| 7 | | | | | | | | | 7 |
| 6 | | | | | | | | | 6 |
| 5 | | | | | | | | | 5 |
| 4 | | | | | | | | | 4 |
| 3 | | | | | | | | | 3 |
| 2 | | | | | | | | | 2 |
| 1 | | | | | | | | | 1 |
| | a | b | c | d | e | f | g | h | |
10. Bxd7+ is necessary to give the a7-knight a retreat square.
# Chess Opening Theory/1. e4/1...e5/2. Nf3/2...Nc6/3. Bb5/3...f5/4. Nc3/4...fxe4/5. Nxe4/5...d5/6. Nxe5/6...dxe4/7. Nxc6/7...Qg5

| | a | b | c | d | e | f | g | h | |
| 8 | | | | | | | | | 8 |
| 7 | | | | | | | | | 7 |
| 6 | | | | | | | | | 6 |
| 5 | | | | | | | | | 5 |
| 4 | | | | | | | | | 4 |
| 3 | | | | | | | | | 3 |
| 2 | | | | | | | | | 2 |
| 1 | | | | | | | | | 1 |
| | a | b | c | d | e | f | g | h | |
White turns the tables on Black with 8. Qe2, defending the b5-bishop and attacking the e4-pawn. The discovered check isn't as exciting as it looks thanks to the possibility of ...c6 in response. There's nothing to be gained by the panicked retreat 8.Nd4+ c6 9.Bf1, for example.
# Chess Opening Theory/1. e4/1...e5/2. Nf3/2...Nc6/3. Bb5/3...f5/4. Nc3/4...fxe4/5. Nxe4/5...d5/6. Nxe5/6...dxe4/7. Nxc6/7...Qg5/8. Qe2

| | a | b | c | d | e | f | g | h | |
| 8 | | | | | | | | | 8 |
| 7 | | | | | | | | | 7 |
| 6 | | | | | | | | | 6 |
| 5 | | | | | | | | | 5 |
| 4 | | | | | | | | | 4 |
| 3 | | | | | | | | | 3 |
| 2 | | | | | | | | | 2 |
| 1 | | | | | | | | | 1 |
| | a | b | c | d | e | f | g | h | |
Black has to defend the e4-pawn, and does so with 8...Nf6, which has the additional benefit of covering h5.
8...Bf5 has a specific tactical problem: 9.f4! is a counter-sacrifice that White wants to play anyway, and with the bishop on f5 the pawn can't be taken: 9...Qxf4?? 10.Rf1 Qg5 11.Rxf5 Qxf5 12.Nd4+ is curtains. Plus, in the current position Black does have a secondary threat of ...a6 and ...Bd7 pinning and winning the c6-knight, which doesn't work if the bishop is away defending e4. Plus, f6 is almost certainly the best square for the knight anyway.
Another line that doesn't work is 8...Qxg2. The downside of playing ...f5 in the opening is the need to be vigilant about queen checks on h5. Here 9.Qh5+ g6 (or 9...Qg6 10.Ne5+) 10.Qe5+ punishes Black severely for her pawn-grabbing. 8...Nf6 cuts out this check, turning the illusory threat of ...Qxg2 into a real one.
# Chess Opening Theory/1. e4/1...e5/2. Nf3/2...Nc6/3. Bb5/3...f5/4. Nc3/4...fxe4/5. Nxe4/5...d5/6. Nxe5/6...dxe4/7. Nxc6/7...Qg5/8. Qe2/8...Nf6/9. Nxa7

| | a | b | c | d | e | f | g | h | |
| 8 | | | | | | | | | 8 |
| 7 | | | | | | | | | 7 |
| 6 | | | | | | | | | 6 |
| 5 | | | | | | | | | 5 |
| 4 | | | | | | | | | 4 |
| 3 | | | | | | | | | 3 |
| 2 | | | | | | | | | 2 |
| 1 | | | | | | | | | 1 |
| | a | b | c | d | e | f | g | h | |
9...Bd7 is the main line. Black preserves castling rights and denies the a7-knight the chance of exchanging itself on c8, which would be the coward's way out. It looks as though the move overworks the f6-knight, but in fact there are tactical reasons why grabbing the e4-pawn doesn't lead to any advantage.
9...Kd8 invites 10.Nxc8 and it looks like White has no problems, but Black has a glimmer of hope based on the fact that g2 is still hanging. German correspondence player Peter Leisebein is the main champion of this line.
9...c6? 10.Nxc6! means the c8-bishop will have to go to d7 anyway, but with one fewer Black pawn on the board.
# Artificial Intelligence/Resources

Resources for further reading and references consulted in writing this book.

## Wikibooks

* Artificial Neural Networks
* Expert Systems

## Internet

* https://en.wikiversity.org/wiki/Portal:Artificial_intelligence
# Artificial Intelligence/Search/Exhaustive search/Breadth-first search
## Introduction

Breadth-first search (BFS) technique is a systematic search strategy which begins at an initial node (an initial state) and from the initial node search actions are applied downward on a tree structure in a breadth-wise order.
The search action consists of:
* Selecting a node as a current node
* Testing the current node for meeting the goal test criteria
* If the goal state is not reached, select the next node in a breadth-wise order
* The search ends either when all the nodes have been searched or if the goal has been found.
In the car key example, the BFS search order follows node sequence: 1, 2, 3, 4, 5… and so on in breadth-first order. The BFS search will first go through all the rooms, then all the desks, then all the drawers in that sequence.
Figure 1 Car key search space

## Implementation

BFS can be implemented using a list or a queue data structure. Initially the list contains just the initial state. The search algorithm involves the repeated testing and removing of the first node from the front of the list, and then finding and appending the node’s successors to the list. This process continues until the first node in the list is the goal state or the list is empty.
Continuing with the car key example, the list is initialized to:
After node 1 fails the goal test, it is removed from the list and the successor node 2, 3, 4 are appended to the list:
When Node 2 is tested and removed, and node 5 is appended:
The search is successfully terminated when node 3 is identified as the goal state i.e. the car key is found in room B.

## Advantages and Disadvantages

BFS is an exhaustive search algorithm. It is simple to implement. And it can be applied to any search problem. Comparing BFS to depth-first search algorithm, BFS does not suffer from any potential infinite loop problem , which may cause the computer to crash whereas depth first search goes deep down searching. One disadvantage of BFS is that it is a ‘blind’ search, when the search space is large the search performance will be poor compared to other heuristic searches.
BFS will perform well if the search space is small. It performs best if the goal state lies in upper left-hand side of the tree. But it will perform relatively poorly relative to the depth-first search algorithm if the goal state lies in the bottom of the tree. BFS will always find the shortest path if the weight on the links are uniform.So BFS is complete and optimal. As we discussed memory utilization is poor in BFS, so we can say that BFS needs more memory as compared to DFS.

## References

* Wikipedia (2008/10/10). http://en.wikipedia.org/wiki/Breadth-first_search
* Cawsey A. 1998. The Essence of Artificial Intelligence. Europe, Prentice Hall
# Artificial Intelligence/Search/Exhaustive search

* Depth-first search
* Breadth-first search
* Finite state automata
# Artificial Intelligence/Search
## Introduction

The general concept of ‘searching’ is about looking for something. For example, we want to drive to some destination and we need to find the car key. Locating the car key is a simple search problem. In computer science, searching techniques are strategies that look for solutions to a problem in a search space. The solutions or ‘goal states’ could sometimes be an object, a goal, a sub-goal or a path to the searched item. In the car key example, the search goal is the car key and the search space is confined to the owner’s home. The car key can be located anywhere in the owner’s house.
In general, a computer search problem has the following characteristics:
* A goal state – the definition of a need
* An initial state – a current position or a set of conditions
* A set of actions - strategies and actions to select and evaluate an option in the search space
* Goal test criteria – criteria used to test if an option is a solution
* A path cost - the cost of the actions in a search path

## Search Space

The search space can be represented by a ‘graph’ which is based on graph theory. The ‘graph’ structure is not to be confused with the graphs that the readers might have learned from their regular mathematics courses. A computer ‘tree’ data structure is a special kind of graph. A tree has a root node on the top of the structure and it has at most one path to each node. Each node may be connected to a lower level of neighbors which are called child nodes (successors). Nodes that have no children are called leaf nodes.
Using the car key example, the owner’s home is defined as the search space. It has the ‘home’ node as the root of a tree. The home node has three child nodes (the room nodes) and other child nodes such as desks and drawer in the rooms. The set of possible permutations that can be examined by a search method in order to find a solution.

## Types of Search

* A* search
* Beam search
* Best-first search
* Bidirectional search
* Breadth-first search
* Depth-first search
* Dijkstra's algorithm
* Finite state automate
* Hill climbing
* Minimax search
* Recommender systems
* Tabu search
# Artificial Intelligence/Search/Exhaustive search/Finite state automata
## Searching with Finite State Automata

A common way of searching for a pattern in a string of symbols is by using Finite State Automata, also known as finite state machines or FSMs. FSMs are abstract structures which can be implemented in a number of different ways, but all of them share some common properties. Each FSM has:
* a finite set of states
* a way of receiving inputs
* transitions, which are paths from one state to another triggered by inputs
* optional actions, which come in a few different flavours depending on what kind of event triggers them:
** entry actions occur when entering a particular state
** exit actions occur when exiting a particular state
** input actions only occur when a particular class of input is received while the machine is in a particular state
** transition actions occur during specified transitions

### Acceptors

When used for pattern matches within strings, an FSM is given each successive character of the string as its input. For simple substring matching, the FSM would have one state for each number of characters in the substring matched so far.
Finite state automata which simply accept or reject an input string with a yes/no response are called acceptors. Here is a state diagram of an acceptor that returns a "yes" response when a string contains the substring "aba":
The machine starts in the "empty" state, representing an empty substring buffer. The "other" transitions represent inputs of any character besides "a" or "b", so the only input that will get the machine out of the empty state is the first character of the substring to be matched, "a". From then on, inputs are converted into transitions from state to state.
The double circle around "aba" indicates that it is an accept state of this FSM, meaning that the machine will give a "yes" result if it is in this state when it has no more inputs to process. All other states are non-accpting states and would result in a "no" result at the end of processing.

### Transducers

An FSM with actions that provide output is instead called a finite state transducer. Here is an example of a transducer written in Ruby which strips C++/Java-style comments out of an input stream:
The transitions and input actions are both defined in nested hash tables keyed by input and state. The input method takes in a single character of the input string, performs any necessary transition to a new state, and returns the transduced character based on the original state. This diagram shows the transitions and states defined in this machine:

### References

* ↑ Wagner, Ferdinand (2006). Modeling Software with Finite State Machines. CRC Press. p. 369. ISBN 0849380863. {{cite book}}: Unknown parameter |coauthors= ignored (|author= suggested) (help)
* 1 2 Roche, Emmanuel (1997). Finite-state language processing. MIT Press. p. 464. ISBN 0262181827.

### Further Reading

* Booth, Taylor L. (1967). Sequential Machines and Automata Theory (1st ed.). New York: John Wiley and Sons, Inc. Library of Congress Card Catalog Number 67-25924. {{cite book}}: Cite has empty unknown parameter: |coauthors= (help)
# Artificial Intelligence/Search/Heuristic search/Beam search
## Definition

Beam search is a restricted, or modified, version of either a breadth-first search or a best-first search. It is restricted in the sense that the amount of memory available for storing the set of alternative search nodes is limited, and in the sense that non-promising nodes can be pruned at any step in the search (Zhang, 1999). The pruning of non-promising nodes is determined by problem-specific heuristics (Zhang, 1999). The set of most promising, or best alternative, search nodes is called the “beam” (Xu and Fern, 2007). Essentially, beam search is a forward-pruning, heuristic search.

## Search Components and Algorithm

A beam search takes three components as its input: a problem to be solved, a set of heuristic rules for pruning, and a memory with a limited available capacity (Zhang, 1999). The problem is the problem to be solved, usually represented as a graph, and contains a set of nodes in which one or more of the nodes represents a goal. The set of heuristic rules are rules specific to the problem domain and prune unfavourable nodes from the memory in respect to the problem domain. The memory is where the “beam” is stored, where when memory is full and a node is to be added to the beam, the most costly node will be deleted, such that the memory limit is not exceeded.
The following algorithm for a beam search, as a modified best-first search, is adapted from Zhang’s 1999:

## Advantages, Disadvantages, and Practical Applications

Beam search has the advantage of potentially reducing the computation, and hence the time, of a search (Xu and Fern, 2007). As well, the memory consumption of the search is far less than its underlying search methods (Furcy and Koenig). This potential advantage rests upon the accuracy and effectiveness of the heuristic rules used for pruning, and having such rules can be somewhat difficult due to the expert knowledge required of the problem domain (Zhang, 1999). The main disadvantages of a beam search are that the search may not result in an optimal goal and may not even reach a goal at all. In fact, the beam search algorithm terminates for two cases: a required goal node is reached, or a goal node is not reached and there are no nodes left to be explored (Zhang, 1999). Beam search has the potential to be incomplete. Despite these disadvantages, beam search has found success in the practical areas of speech recognition, vision, planning, and machine learning (Zhang, 1999).

## References

* Zhang, W. (1999). State-space search: Algorithms, complexity, extensions, and applications. Springer: New York.
* Xu, Y., Fern, A. (2007). On learning linear ranking functions for beam search. Retrieved on March 8, 2009, from http://www.machinelearning.org/proceedings/icml2007/papers/168.pdf
* Furcy, D., Koenig, S. Limited discrepancy beam search. Retrieved on March 8, 2009, from http://www.ijcai.org/papers/0596.pdf
# CAT-Tools/DéjàVu X/SRX
## Support for Segmentation Rules eXchange (SRX)

Segmentation Rules eXchange (SRX) is an XML-based standard for description of the ways in which translation and other language-processing tools segment text for processing. It was created when it was realized that TMX leverage is lower than expected in certain instances due to differences in how tools segment text. SRX is intended to enhance the TMX standard so that translation memory (TM) data that is exchanged between applications can be used more effectively. Having the segmentation rules that were used when a TM was created will increase the leverage that can be achieved when deploying the TM data.
SRX version 1.0 was officially accepted as an OSCAR standard in April 2004.
# Bugs (Specific languages: Japanese as source language)
## 1. Scan function (Ctrl+S)

Added: --Loek van Kooten 18:19, 5 February 2007 (UTC)
Version: 7.0.284
System: Windows XP SP2
Description: Scan function (also known as Concordance in other CAT tools) does not work reliably. Words in Japanese source text are not always found. No pattern has been established yet.
Reproduction:
Workaround:
Status:
Not read by Atril yet.
Comments from other users:
# CAT-Tools/DéjàVu X/Scan

* Results in Scan Results window ordered by relevance, i.e., exact matches shown before fuzzy matches, and then matches from same client/subject shown before those with different client/subject. (Alessandra Muzzi)
* Option to perform memory database scans and retrieve only entries with same client/subject as the current project (preferably an option selectable on-the-fly or a shortcut different from Ctrl+S, not a permanent option in Tools > Options). (Alessandra Muzzi & Walter Weyne, a must IMHO)
* Option to edit and delete found segments, just like in AutoSearch (Walter Weyne)
* Option to scan in other languages in DVX WG (Walter Weyne)
# CAT-Tools/DéjàVu X/Search and Replace

* Search & Replace should end up where it started and give the total number of replacements (Martin Wunderlich)
* Search and Replace should have the option "Update Translation Memory accordingly" . (Georgy Moiseenko)
* When performing a Replace all, indicate how many replacements were done (useful to count how many times a word is used), as in Word and keep the cursor in the original segment, rahter than the last updated segment (Walter Weyne)
* And should not loose focus when complete (Jenny Zonneveld)
* Should (as a second alternative to the "Match case" option) be able to handle case "intelligently", as in GNU Emacs (and Word?): if the replaced word (the match found) is uppercase, the replacement should be uppercase, too. If the replaced word is lowercase, the replacement should be lowercase. (Florian v. Savigny) (And yes - S&R's losing focus is very annoying, I fully agree!)
# CAT-Tools/DéjàVu X/Project Properties

* Store original import directory in project so that it can be exported (by default) again to a subdirectory of the original import directory instead than the last export directory, as is the current default option (Lorenzo Martinelli - edited by Alessandra Muzzi)
* Being able to prune unwanted languages from list of languages available (Lorenzo Martinelli)
* Ability to set a default directory for exporting projects, selectable among: 1) The directory where the project resides; 2) The directory source files were imported from; 3) A user-specified directory. (Alessandra Muzzi)
* Project templates that allow users to specify, once and for all, settings such as Client, Subject, Memory Database(s), Terminology Database(s), any custom settings, and possibly lexicon (saved in the template and updated each time that template is used for a project). (Alessandra Muzzi)
* Templates for all procedures currently managed by wizards, that allow expert users to bypass the multiple wizard steps/screens by selecting the appropriate template. (Alessandra Muzzi)