]> gitweb.fperrin.net Git - DictionaryPC.git/blob - src/com/hughes/android/dictionary/parser/EnWiktionaryXmlParser.java.old
More languages, simpler splitter.
[DictionaryPC.git] / src / com / hughes / android / dictionary / parser / EnWiktionaryXmlParser.java.old
1 // Copyright 2011 Google Inc. All Rights Reserved.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //     http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 package com.hughes.android.dictionary.parser;
16
17 import java.io.File;
18 import java.io.IOException;
19 import java.util.ArrayList;
20 import java.util.Arrays;
21 import java.util.LinkedHashSet;
22 import java.util.List;
23 import java.util.Map;
24 import java.util.Set;
25 import java.util.regex.Pattern;
26
27 import javax.xml.parsers.ParserConfigurationException;
28 import javax.xml.parsers.SAXParser;
29 import javax.xml.parsers.SAXParserFactory;
30
31 import org.xml.sax.Attributes;
32 import org.xml.sax.SAXException;
33
34 import com.hughes.android.dictionary.engine.DictionaryBuilder;
35 import com.hughes.android.dictionary.engine.IndexBuilder;
36 import com.hughes.android.dictionary.parser.WikiWord.FormOf;
37 import com.hughes.android.dictionary.parser.WikiWord.Translation;
38 import com.hughes.util.ListUtil;
39 import com.hughes.util.StringUtil;
40
41 public class EnWiktionaryXmlParserOld extends org.xml.sax.helpers.DefaultHandler implements WikiCallback {
42   
43   static final Pattern partOfSpeechHeader = Pattern.compile(
44       "Noun|Verb|Adjective|Adverb|Pronoun|Conjunction|Interjection|" +
45       "Preposition|Proper noun|Article|Prepositional phrase|Acronym|" +
46       "Abbreviation|Initialism|Contraction|Prefix|Suffix|Symbol|Letter|" +
47       "Ligature|Idiom|Phrase|" +
48       // These are @deprecated:
49       "Noun form|Verb form|Adjective form|Nominal phrase|Noun phrase|" +
50       "Verb phrase|Transitive verb|Intransitive verb|Reflexive verb|" +
51       // These are extras I found:
52       "Determiner|Numeral|Number|Cardinal number|Ordinal number|Proverb|" +
53       "Particle|Interjection|Pronominal adverb" +
54       "Han character|Hanzi|Hanja|Kanji|Katakana character|Syllable");
55
56   static final Pattern wikiMarkup =  Pattern.compile("\\[\\[|\\]\\]|''+");
57
58   final DictionaryBuilder dictBuilder;
59   
60   final IndexBuilder[] indexBuilders;
61   final Pattern[] langPatterns;
62   final int enIndexBuilder;
63
64   StringBuilder titleBuilder;
65   StringBuilder textBuilder;
66   StringBuilder currentBuilder = null;
67   
68   static void assertTrue(final boolean condition) {
69     assertTrue(condition, "");
70   }
71
72   static void assertTrue(final boolean condition, final String message) {
73     if (!condition) {
74       System.err.println("Assertion failed, message: " + message);
75       new RuntimeException().printStackTrace(System.err);
76     }
77   }
78
79   public EnWiktionaryXmlParserOld(final DictionaryBuilder dictBuilder, final Pattern[] langPatterns, final int enIndexBuilder) {
80     assertTrue(langPatterns.length == 2);
81     this.dictBuilder = dictBuilder;
82     this.indexBuilders = dictBuilder.indexBuilders.toArray(new IndexBuilder[0]);
83     this.langPatterns = langPatterns;
84     this.enIndexBuilder = enIndexBuilder;
85   }
86
87   @Override
88   public void startElement(String uri, String localName, String qName,
89       Attributes attributes) {
90     currentBuilder = null;
91     if ("page".equals(qName)) {
92       titleBuilder = new StringBuilder();
93       
94       // Start with "\n" to better match certain strings.
95       textBuilder = new StringBuilder("\n");
96     } else if ("title".equals(qName)) {
97       currentBuilder = titleBuilder;
98     } else if ("text".equals(qName)) {
99       currentBuilder = textBuilder;
100     }
101   }
102
103   @Override
104   public void characters(char[] ch, int start, int length) throws SAXException {
105     if (currentBuilder != null) {
106       currentBuilder.append(ch, start, length);
107     }
108   }
109
110   @Override
111   public void endElement(String uri, String localName, String qName)
112       throws SAXException {
113     currentBuilder = null;
114     if ("page".equals(qName)) {
115       endPage();
116     }
117   }
118   
119
120   public void parse(final File file) throws ParserConfigurationException,
121       SAXException, IOException {
122     final SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
123     parser.parse(file, this);
124   }
125   
126   int pageCount = 0;
127   private void endPage() {
128     title = titleBuilder.toString();
129     ++pageCount;
130     if (pageCount % 1000 == 0) {
131       System.out.println("pageCount=" + pageCount);
132     }
133     if (title.startsWith("Wiktionary:") ||
134         title.startsWith("Template:") ||
135         title.startsWith("Appendix:") ||
136         title.startsWith("Category:") ||
137         title.startsWith("Index:") ||
138         title.startsWith("MediaWiki:") ||
139         title.startsWith("TransWiki:") ||
140         title.startsWith("Citations:") ||
141         title.startsWith("Concordance:") ||
142         title.startsWith("Help:")) {
143       return;
144     }
145     currentDepth = 0;
146     words.clear();
147     currentHeading = null;
148     insidePartOfSpeech = false;
149 //    System.err.println("Working on page: " + title);
150     try {
151       WikiParser.parse(textBuilder.toString(), this);
152     } catch (Throwable e) {
153       System.err.println("Failure on page: " + title);
154       e.printStackTrace(System.err); 
155     }
156
157    for (final WikiWord word : words) {
158      word.wikiWordToQuickDic(dictBuilder, enIndexBuilder);
159    }  // WikiWord
160    
161   }  // endPage()
162
163
164   // ------------------------------------------------------------------------
165   // ------------------------------------------------------------------------
166   // ------------------------------------------------------------------------
167   // ------------------------------------------------------------------------
168
169   /**
170    * Two things can happen:
171    * 
172    * We can be in a ==German== section.  There we will see English definitions.
173    * Each POS should get its own QuickDic entry.  Pretty much everything goes
174    * in.
175    * 
176    * Or we can be in an ==English== section with English definitions
177    * and maybe see translations for languages we care about.
178    * 
179    * In either case, we need to differentiate the subsections (Noun, Verb, etc.)
180    * into separate QuickDic entries, but that's tricky--how do we know when we
181    * found a subsection?  Just ignore anything containing pronunciation and
182    * etymology?
183    * 
184    * How do we decide when to seal the deal on an entry?
185    * 
186    * Would be nice if the parser told us about leaving sections....
187    * 
188    * 
189    */
190
191   String title;
192   String currentHeading;
193   int currentDepth;
194   final List<WikiWord> words = new ArrayList<WikiWord>();
195   WikiWord currentWord;
196   WikiWord.PartOfSpeech currentPartOfSpeech;
197   WikiWord.TranslationSense currentTranslationSense;
198   boolean insidePartOfSpeech;
199   
200   StringBuilder wikiBuilder = null;
201   
202   @Override
203   public void onWikiLink(String[] args) {
204     if (wikiBuilder == null) {
205       return;
206     }
207     wikiBuilder.append(args[args.length - 1]);
208   }
209   
210   // ttbc: translations to be checked.
211   static final Set<String> useRemainingArgTemplates = new LinkedHashSet<String>(Arrays.asList(
212       "Arab", "Cyrl", "fa-Arab", "italbrac", "Khmr", "ku-Arab", "IPAchar", "Laoo", 
213       "sd-Arab", "Thai", "ttbc", "unicode", "ur-Arab", "yue-yue-j", "zh-ts", 
214       "zh-tsp", "zh-zh-p", "ug-Arab", "ko-inline", "Jpan", "Kore", "rfscript", "Latinx"));
215   static final Set<String> ignoreTemplates = new LinkedHashSet<String>(Arrays.asList("audio", "rhymes", "hyphenation", "homophones", "wikipedia", "rel-top", "rel-bottom", "sense", "wikisource1911Enc", "g"));
216   static final Set<String> grammarTemplates = new LinkedHashSet<String>(Arrays.asList("impf", "pf", "pf.", "indeclinable"));
217   static final Set<String> passThroughTemplates = new LinkedHashSet<String>(Arrays.asList("zzzzzzzzzzzzzzz"));
218
219   @Override
220   public void onTemplate(final List<String> positionalArgs, final Map<String,String> namedArgs) {
221     if (positionalArgs.isEmpty()) {
222       // This happens very rarely with special templates.
223       return;
224     }
225     final String name = positionalArgs.get(0);
226     
227     namedArgs.remove("lang");
228     namedArgs.remove("nocat");
229     namedArgs.remove("nocap");
230     namedArgs.remove("sc");
231
232     // Pronunciation
233     if (currentWord != null) {
234       if (name.equals("a")) {
235         // accent tag
236         currentWord.currentPronunciation = new StringBuilder();
237         currentWord.accentToPronunciation.put(positionalArgs.get(1), currentWord.currentPronunciation);
238         return;
239       }
240       
241       if (name.equals("IPA") || name.equals("SAMPA") || name.equals("X-SAMPA") || name.equals("enPR")) {
242         namedArgs.remove("lang");
243         for (int i = 0; i < 100 && !namedArgs.isEmpty(); ++i) {
244           final String pron = namedArgs.remove("" + i);
245           if (pron != null) {
246             positionalArgs.add(pron);
247           } else {
248             if (i > 10) {
249               break;
250             }
251           }
252         }
253         if (!(positionalArgs.size() >= 2 && namedArgs.isEmpty())) {
254           System.err.println("Invalid pronunciation: " + positionalArgs.toString() + namedArgs.toString());
255         }
256         if (currentWord.currentPronunciation == null) {
257           currentWord.currentPronunciation = new StringBuilder();
258           currentWord.accentToPronunciation.put("", currentWord.currentPronunciation);
259         }
260         if (currentWord.currentPronunciation.length() > 0) {
261           currentWord.currentPronunciation.append("; ");
262         }
263         for (int i = 1; i < positionalArgs.size(); ++i) {
264           if (i > 1) {
265             currentWord.currentPronunciation.append(",");
266           }
267           final String pron = wikiMarkup.matcher(positionalArgs.get(1)).replaceAll("");
268           currentWord.currentPronunciation.append(pron).append("");
269         }
270         currentWord.currentPronunciation.append(" (").append(name).append(")");
271         return;
272       }
273       
274       if (name.equals("qualifier")) {
275         //assertTrue(positionalArgs.size() == 2 && namedArgs.isEmpty() : positionalArgs.toString() + namedArgs.toString());
276         if (wikiBuilder == null) {
277           return;
278         }
279         wikiBuilder.append(" (").append(positionalArgs.get(1)).append(")");
280         return;
281       }
282       
283       if (name.equals("...")) {
284         // Skipping any elided text for brevity.
285         wikiBuilder.append("...");
286         return;
287       }
288       
289       if (passThroughTemplates.contains(name)) {
290         assertTrue(positionalArgs.size() == 1 && namedArgs.isEmpty(), positionalArgs.toString() + namedArgs);
291         wikiBuilder.append(name);
292         return;
293       }
294       
295       if (ignoreTemplates.contains(name)) {
296         return;
297       }
298       
299       if ("Pronunciation".equals(currentHeading)) {
300         System.err.println("Unhandled pronunciation template: " + positionalArgs + namedArgs);
301         return;
302       }
303     }  // Pronunciation
304     
305     // Part of speech
306     if (insidePartOfSpeech) {
307       
308       // form of
309       if (name.equals("form of")) {
310         namedArgs.remove("sc");
311         if (positionalArgs.size() < 3 || positionalArgs.size() > 4) {
312           System.err.println("Invalid form of.");
313         }
314         final String token = positionalArgs.get(positionalArgs.size() == 3 ? 2 : 3);
315         final String grammarForm = WikiParser.simpleParse(positionalArgs.get(1));
316         currentPartOfSpeech.formOfs.add(new FormOf(grammarForm, token));
317         return;
318       }
319       
320       // The fallback plan: append the template!
321       if (wikiBuilder != null) {
322         wikiBuilder.append("{");
323         boolean first = true;
324         for (final String arg : positionalArgs) {
325           if (!first) {
326             wikiBuilder.append(", ");
327           }
328           first = false;
329           wikiBuilder.append(arg);
330         }
331         // This one isn't so useful.
332         for (final Map.Entry<String, String> entry : namedArgs.entrySet()) {
333           if (!first) {
334             wikiBuilder.append(", ");
335           }
336           first = false;
337           wikiBuilder.append(entry.getKey()).append("=").append(entry.getValue());
338         }
339         wikiBuilder.append("}");
340       }
341       
342       //System.err.println("Unhandled part of speech template: " + positionalArgs + namedArgs);
343       return;
344     }  // Part of speech
345
346     
347     // Translations
348     if (name.equals("trans-top")) {
349       assertTrue(positionalArgs.size() >= 1 && namedArgs.isEmpty(), positionalArgs.toString() + namedArgs + title);
350       
351       if (currentPartOfSpeech == null) {
352         assertTrue(currentWord != null && !currentWord.partsOfSpeech.isEmpty(),  title); 
353         System.err.println("Assuming last part of speech for non-nested translation section: " + title);
354         currentPartOfSpeech = ListUtil.getLast(currentWord.partsOfSpeech);
355       }
356       
357       currentTranslationSense = new WikiWord.TranslationSense();
358       currentPartOfSpeech.translationSenses.add(currentTranslationSense);
359       if (positionalArgs.size() > 1) {
360         currentTranslationSense.sense = positionalArgs.get(1);
361       }
362       return;
363     }  // Translations
364
365     if (wikiBuilder == null) {
366       return;
367     }    
368     if (name.equals("m") || name.equals("f") || name.equals("n") || name.equals("c")) {
369       assertTrue(positionalArgs.size() >= 1 && namedArgs.isEmpty(), positionalArgs.toString() + namedArgs.toString());
370       wikiBuilder.append("{");
371       for (int i = 1; i < positionalArgs.size(); ++i) {
372         wikiBuilder.append(i > 1 ? "," : "");
373         wikiBuilder.append(positionalArgs.get(i));
374       }
375       wikiBuilder.append(name).append("}");
376       
377     } else  if (name.equals("p")) {
378       assertTrue(positionalArgs.size() == 1 && namedArgs.isEmpty());
379       wikiBuilder.append("pl.");
380
381     } else  if (name.equals("s")) {
382       assertTrue(positionalArgs.size() == 1 && namedArgs.isEmpty() || title.equals("dobra"), title);
383       wikiBuilder.append("sg.");
384       
385     } else  if (grammarTemplates.contains(name)) {
386       assert positionalArgs.size() == 1 && namedArgs.isEmpty() : positionalArgs.toString() + namedArgs;
387       wikiBuilder.append(name).append(".");
388
389     } else  if (name.equals("l")) {
390       // This template is designed to generate a link to a specific language-section on the target page.
391       wikiBuilder.append(positionalArgs.size() >= 4 ? positionalArgs.get(3) : positionalArgs.get(2));
392       
393     } else if (name.equals("t") || name.equals("t+") || name.equals("t-") || name.equals("tø")) {
394       if (positionalArgs.size() > 2) {
395         wikiBuilder.append(positionalArgs.get(2));
396       }
397       for (int i = 3; i < positionalArgs.size(); ++i) {
398         wikiBuilder.append(i == 3 ? " {" : ",");
399         wikiBuilder.append(positionalArgs.get(i));
400         wikiBuilder.append(i == positionalArgs.size() - 1 ? "}" : "");
401       }
402       final String transliteration = namedArgs.remove("tr");
403       if (transliteration != null) {
404         wikiBuilder.append(" (").append(transliteration).append(")");
405       }
406       
407     } else  if (name.equals("trreq")) {
408       wikiBuilder.append("{{trreq}}");
409       
410     } else if (name.equals("qualifier")) {
411       //assert positionalArgs.size() == 2 && namedArgs.isEmpty() : positionalArgs.toString() + namedArgs.toString();
412       wikiBuilder.append(" (").append(positionalArgs.get(1)).append(")");
413       
414     } else if (useRemainingArgTemplates.contains(name)) {
415       for (int i = 1; i < positionalArgs.size(); ++i) {
416         if (i != 1) {
417           wikiBuilder.append(", ");
418         }
419         wikiBuilder.append(positionalArgs.get(i));
420       }
421     } else if (ignoreTemplates.contains(name)) {
422       // Do nothing.
423       
424     } else if (name.equals("initialism")) {
425       assert positionalArgs.size() <= 2 && namedArgs.isEmpty() : positionalArgs.toString() + namedArgs;
426       wikiBuilder.append("Initialism");
427     } else if (name.equals("abbreviation")) {
428       assert positionalArgs.size() <= 2 && namedArgs.isEmpty() : positionalArgs.toString() + namedArgs;
429       wikiBuilder.append("Abbreviation");
430     } else if (name.equals("acronym")) {
431       assert positionalArgs.size() <= 2 && namedArgs.isEmpty() : positionalArgs.toString() + namedArgs;
432       wikiBuilder.append("Acronym");
433     } else {
434       if (currentTranslationSense != null) {
435         System.err.println("Unhandled template: " + positionalArgs.toString() + namedArgs);
436       }
437     }
438   }
439
440   @Override
441   public void onText(String text) {
442     if (wikiBuilder != null) {
443       wikiBuilder.append(text);
444       return;
445     }
446   }
447
448   @Override
449   public void onHeadingStart(int depth) {
450     wikiBuilder = new StringBuilder();
451     currentDepth = depth;
452     if (currentPartOfSpeech != null && depth <= currentPartOfSpeech.depth) {
453       currentPartOfSpeech = null;
454       insidePartOfSpeech = false;
455     }
456     if (currentWord != null && depth <= currentWord.depth) {
457       currentWord = null;
458     }
459     
460     currentHeading = null;
461   }
462   
463   @Override
464   public void onHeadingEnd(int depth) {
465     final String name = wikiBuilder.toString().trim();
466     wikiBuilder = null;
467     currentTranslationSense = null;
468     currentHeading = name;
469     
470     final boolean lang0 = langPatterns[0].matcher(name).matches();
471     final boolean lang1 = langPatterns[1].matcher(name).matches();
472     if (name.equalsIgnoreCase("English") || lang0 || lang1 || name.equalsIgnoreCase("Translingual")) {
473       currentWord = new WikiWord(title, depth);
474       if (lang0 && lang1) {
475         System.err.println("Word is indexed in both index1 and index2: " + title);
476       }
477       currentWord.language = name;
478       currentWord.index = lang0 ? 0 : (lang1 ? 1 : -1);
479       words.add(currentWord);
480       return;
481     }
482     
483     if (currentWord == null) {
484       return;
485     }
486     
487     if (currentPartOfSpeech != null && depth <= currentPartOfSpeech.depth) {
488       currentPartOfSpeech = null;
489     }
490     
491     insidePartOfSpeech = false;
492     if (currentPartOfSpeech == null && partOfSpeechHeader.matcher(name).matches()) {
493       currentPartOfSpeech = new WikiWord.PartOfSpeech(depth, name);
494       currentWord.partsOfSpeech.add(currentPartOfSpeech);
495       insidePartOfSpeech = true;
496       return;
497     }
498     
499     if (name.equals("Translations")) {
500       if (currentWord == null || 
501           !currentWord.language.equals("English") || 
502           currentPartOfSpeech == null) {
503         System.err.println("Unexpected Translations section: " + title);
504         return;
505       }
506       currentTranslationSense = new WikiWord.TranslationSense();
507     }
508     
509   }
510
511   @Override
512   public void onListItemStart(String header, int[] section) {
513     wikiBuilder = new StringBuilder();
514     if (currentWord != null) {
515       currentWord.currentPronunciation = null;
516     }
517   }
518   
519
520   @Override
521   public void onListItemEnd(String header, int[] section) {
522     String item = wikiBuilder.toString().trim();
523     if (item.length() == 0) {
524       return;
525     }
526     item = WikiParser.simpleParse(item);
527     wikiBuilder = null;
528         
529     // Part of speech
530     if (insidePartOfSpeech) {
531       assert currentPartOfSpeech != null : title + item;
532       if (header.equals("#") || 
533           header.equals("##") || 
534           header.equals("###") || 
535           header.equals("####") || 
536           header.equals(":#") || 
537           header.equals("::") ||
538           header.equals(":::*")) {
539         // Definition.
540         // :: should append, probably.
541         currentPartOfSpeech.newMeaning().meaning = item;
542         
543       // Source
544       } else if (header.equals("#*") ||
545                  header.equals("##*") ||
546                  header.equals("###*")) {
547         currentPartOfSpeech.lastMeaning().newExample().source = item;
548         
549       // Example
550       } else if (header.equals("#:") || 
551                  header.equals("#*:") || 
552                  header.equals("#:*") || 
553                  header.equals("##:") || 
554                  header.equals("##*:") || 
555                  header.equals("#:*:") || 
556                  header.equals("#:*#") ||
557                  header.equals("#*:") ||
558                  header.equals("*:") || 
559                  header.equals("#:::") ||
560                  header.equals("#**") ||
561                  header.equals("#*:::") ||
562                  header.equals("#:#") ||
563                  header.equals(":::") ||
564                  header.equals("##:*") ||
565                  header.equals("###*:")) {
566         StringUtil.appendLine(currentPartOfSpeech.lastMeaning().newExample().example, item);
567         
568       // Example in English
569       } else if (header.equals("#::") || 
570                  header.equals("#*::") || 
571                  header.equals("#:**") ||
572                  header.equals("#*#") ||
573                  header.equals("##*::")) {
574         StringUtil.appendLine(currentPartOfSpeech.lastMeaning().lastExample().exampleInEnglish, item);
575         
576       // Skip
577       } else if (header.equals("*") ||
578                  header.equals("**") ||
579                  header.equals("***") || 
580                  header.equals("*#") ||
581                  header.equals(":") ||
582                  header.equals("::*") ||
583                  header.equals("#**") ||
584                  header.equals(":*") ||
585                  header.equals("#*:*") ||
586                  header.equals("#*:**") || 
587                  header.equals("#*:#") || 
588                  header.equals("#*:*:") || 
589                  header.equals("#*:*") || 
590                  header.equals(";")) {
591         // might have: * {{seeCites}}
592         // * [[w:Arabic numerals|Arabic numerals]]: 2
593         //assert item.trim().length() == 0;
594         System.err.println("Skipping meaning: " + header + " " + item);
595       } else {
596         if (title.equals("Yellowknife")) {
597           return;
598         }
599         System.err.println("Busted heading: " + title + "  "+ header + " " + item);
600       }
601       return;
602     }
603     // Part of speech
604     
605     // Translation
606     if (currentTranslationSense != null) {
607       if (item.indexOf("{{[trreq]{}}}") != -1) {
608         return;
609       }
610
611       if (currentPartOfSpeech.translationSenses.isEmpty()) {
612         currentPartOfSpeech.translationSenses.add(currentTranslationSense);
613       }
614
615       final int colonPos = item.indexOf(':');
616       if (colonPos == -1) {
617         System.err.println("Invalid translation: title=" + title +  ",  item=" + item);
618         return;
619       }
620       final String lang = item.substring(0, colonPos);
621       final String trans = item.substring(colonPos + 1).trim();
622       for (int i = 0; i < 2; ++i) {
623         if (langPatterns[i].matcher(lang).find()) {
624           currentTranslationSense.translations.get(i).add(new Translation(lang, trans));
625         }
626       }
627     } // Translation
628   }
629
630   @Override
631   public void onNewLine() {
632   }
633
634   @Override
635   public void onNewParagraph() {
636   }
637
638   // ----------------------------------------------------------------------
639   
640   @Override
641   public void onComment(String text) {
642   }
643
644   @Override
645   public void onFormatBold(boolean boldOn) {
646   }
647
648   @Override
649   public void onFormatItalic(boolean italicOn) {
650   }
651
652   @Override
653   public void onUnterminated(String start, String rest) {
654     System.err.printf("OnUnterminated: %s %s %s\n", title, start, rest);
655   }
656   @Override
657   public void onInvalidHeaderEnd(String rest) {
658     throw new RuntimeException(rest);
659   }
660
661 }