# Formation Control of Multiple Autonomous Mobile Robots Using Turkish Natural Language Processing
## 4 Materials and Methods
### Proposed NLP-Based Command-Creation Model
#### 4.1.1 Sentence Analysis  
Natural language commands to be sent to the robot are analyzed by the parser. After analyzing the command sentence, the complement and predicate of the sentence are obtained. With these data, the function of the robot is determined. Since Turkish is an agglutinative language, each word has a complex structure in terms of its form; therefore, the words we derive from a word can have very different meanings. For example, let us consider the word \"kitap\" in this context: Kitap (\"Book\") \(\rightarrow\) noun: A collection of printed or written sheets of paper. Kitapci (\"Bookseller\") \(\rightarrow\) noun: A person who sells books. Kitaplk (\"Bookcase\") \(\rightarrow\) noun: A compartment where books are placed. Kitaplk (\"Bookish\") \(\rightarrow\) adjective: A person who has books. Kitapsiz (\"Bookless\") \(\rightarrow\) adjective: A person without books. As can be seen, the root of the word is a noun, but it can be used to create many different meanings in a sentence. In this study, the \"Turkish Sentence Analyzer (TSA)\" was used for sentence dependency analysis [11; 12]. The TSA is an open-source Java application that performs sentence parsing for Turkish sentences. The book \"Turkish Syntax\" was used to create Turkish syntax rules [65]. Context-free Grammar (CFG), which is a method for describing the structure and syntax of natural languages, was used to test the suitability of the text structure given in the application [66]. Turkish sentences may be created in various forms, for example, \"sentence \(\rightarrow\) verb\", \"sentence \(\rightarrow\) object + verb\", \"sentence \(\rightarrow\) subject + complement + verb\", \"sentence \(\rightarrow\) subject + object + verb\", etc. As can be seen from these examples, a syntactic inference must be made, and it is critical to break down sentences into their elements correctly. Figure 3 shows the parse tree of the sentence structure of \"robot lieriye git (\"robot go forward\")\" generated from the defined grammar. Figure 3: The parse tree of the sentence structure of “robot lieriye git”. CFG is mainly a grammar used to describe a language. The description of natural language cannot cover all language because semantic expressions cannot be defined in this grammar. As can be seen in the example shown in Figure 3, this grammar is created from Turkish syntactic structures. If a sentence given with this grammar is recognized as input, the sentence is accepted as valid. TSA uses Zemberek in the morphological analysis phase while analyzing the given sentence [10]. When performing the morphological analysis, more than one result can be obtained. We can examine this using an example of the Turkish word \"boyun\", which has several meanings. Possible solutions are presented in Table 1. The analyzer basically works as follows: the given sentence is separated on a word-by-word basis, and these words are separated into nouns, adjectives, verbs, etc., with the help of Zemberek. Detailed examples of the identification of word types in different sentences using Zemberek are shown in detail in [67]. Finding a Suitable Solution  
First, only sentences with verbs were used in this study to find a suitable solution. Part-of-speech tagging (via a POS tagger), which uses statistical data, was added to the system to find the appropriate solution. Here, the frequencies of the generated solutions were determined. Each similar solution was identified as an element of a class. The number of classes was unrestricted due to the many solutions found. Then, the frequencies of the specified class elements were calculated. This calculation is shown in Equation (17). \[p_{i}=\frac{f_{i}}{n}\,\ \ \ i=1,\ 2\ \dots k\ \ ;\ \ \ \ \sum_{i=1}^{k}p_{i}=1 \tag{17}\]  
In the equation, \(p_{i}\) is the frequency rate of each class, \(f_{i}\) is the frequency of each class, \(n\) is the total number of data points, and \(k\) is the number of classes. The class element with the highest ratio among the obtained solutions is considered the solution.