## 4 Lexicon Analysis  
Since a document image should have some key characters, these detected characters may be located within the ROI after key character detection. In fact, some detected characters may not be helpful for finding personal information. Then, the following question is related to how to analyze the detected key characters to obtain the correct keywords in ROIs. In fact, a word is often composed of two or three characters in Mandarin Chinese. When trying to find meaningful keywords in a document image, there are two problems. The first one is that two or three arbitrary characters may not be a meaningful word in Mandarin Chinese. For example, the keyword \"\(\
exists\)\" (Property Owner) composed of \"\(\
exists\)\" (Property) and \"\(\exists\)\" (Owner) is a meaningful word, but the combination of \"\(\
exists\)\" (Address) and \"\(\exists\)\" (Owner) is non-meaningful in Mandarin Chinese. In addition, the order of two or three characters is also important for the combination of a meaningful word. For example, the combination of \"\(\
exists\)\" (Surname-First Name) is meaningful, but the combination of \"\(\
exists\)\" (First Name-Surname) is not. This means that a lexicon analysis is necessary in the proposed scheme. On the other hand, the spatial relation of two or three key characters could be horizontal and vertical. As shown in Figure 0(a), the keywords may be arranged in the horizontal or vertical direction. For example, the two keywords, \"\(\
exists\)\" (Property Owner) and \"\(\
exists\)\" (Address), are in the vertical and horizontal directions, respectively. This means that the lexicon analysis algorithm should be performed in the horizontal and vertical directions. Furthermore, the observation that the spatial distance of two or three key characters may be different can be observed in Figure 1. For example, the spatial distance between \"\(\
exists\)\" (Surname) and \"\(\
exists\)\" (First Name) in Figure 0(a) is smaller than that in Figure 0(b). To find two or three characters to generate a meaningful word, a searching algorithm is proposed here. Therefore, a lexicon analysis algorithm is necessary to find and analyze the combination of some possible key characters for obtaining correct keywords. To devise a searching algorithm in the lexicon analysis, an observation that the distance between two characters is usually equal to multiple times a character's width with a document in Taiwan can be utilized. This means that a character's width can be considered as a prior information for developing the searching algorithm. To estimate a character's width, the bounding boxes enclosing the detected characters are collected during the training phase, and then their width information is analyzed to estimate the size information as a prior information. Figure 6 illustrates the lexicon analysis. Assume there are \(N^{\text{KW}}\) keywords determined in the proposed scheme. Then, the lexicon analysis algorithm in the horizontal direction is described as follows:  
1. Select one possible key character \(O_{1}^{\text{KC}}\) as the first one and then measure its center \(\overline{p}_{1}^{\text{C}}\), whose coordinate is \((\overline{x}_{1},\overline{y}_{1})\). For example, \"\(\
exists\)\" (Surname) is the first key character. 2. Determine whether another key character \(O_{i}^{\text{KC}}\) is around \(O_{1}^{\text{KC}}\). According to the prior width information of a character, the positions whose horizontal coordinate is around the position \(\overline{y}_{1}+j\cdot N_{W}^{\text{Ch}}\) are checked whether a key character exists, where j is an integer and \(N_{W}^{\text{Ch}}\) is the estimated width of a key character. If there is a key character around the positions, the second character is considered as the second one \(O_{2}^{\text{KC}}\). For example, \"\(\
exists\)\" (First Name) is the second character. Then, the two key characters are considered as the first keyword candidate \(O_{1}^{\text{KW}}=O_{1}^{\text{KC}}\cup O_{2}^{\text{KC}}\).