实习比较忙,也时间写了,就记录一下自己的代码成长吧,希望能帮到你。

    MainActivity部分:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
package  com.sbs.weather;
 
import  java.io.InputStream;
 
import  javax.xml.parsers.DocumentBuilder;
import  javax.xml.parsers.DocumentBuilderFactory;
 
import  org.apache.http.HttpEntity;
import  org.apache.http.HttpResponse;
import  org.apache.http.client.methods.HttpGet;
import  org.apache.http.client.methods.HttpUriRequest;
import  org.apache.http.impl.client.DefaultHttpClient;
import  org.apache.http.util.EntityUtils;
import  org.w3c.dom.Document;
import  org.w3c.dom.Node;
import  org.w3c.dom.NodeList;
import  org.xml.sax.InputSource;
 
import  com.sbs.weather.DownImage.ImageCallback;
 
import  android.app.Activity;
import  android.app.ProgressDialog;
import  android.graphics.Bitmap;
import  android.graphics.drawable.Drawable;
import  android.net.NetworkInfo.State;
import  android.os.Bundle;
import  android.os.Handler;
import  android.os.Message;
import  android.provider.ContactsContract.CommonDataKinds.Note;
import  android.util.Log;
import  android.view.View;
import  android.widget.Button;
import  android.widget.EditText;
import  android.widget.ImageView;
import  android.widget.TextView;
 
public  class  Weather  extends  Activity {
 
     public  EditText ETplace;
     public  TextView TvPlace;
     public  TextView TvPlace_weather_tomrrow;
     public  TextView TvPlace_weather_next;
     public  TextView TvPlace_weather_detail;
 
     public  Button query;
     public  TextView placeName;
     public  ImageView imView_today1;
     public  ImageView imView_today2;
     public  ImageView imView_tomrrow1;
     public  ImageView imView_tomrrow2;
     public  ImageView imView_next1;
     public  ImageView imView_next2;
     String place;
     // 加载提示框
     private  ProgressDialog dialog =  null ;
     private  final  int  IS_FINISH =  1 ;
     private  Handler handler =  new  Handler() {
         public  void  handleMessage(Message msg) {
             String weather =  "" ;
             String weather_tomrrow =  "" ;
             String weather_next =  "" ;
             String weather_detail =  "" ;
             NodeList n = (NodeList) msg.obj;
 
             // NodeList n = new NodeList();
 
             // String strResult =
             // EntityUtils.toString(resp.getEntity());
             // Log.i("weather->", strResult);
             // 一华氏度等于9/5摄氏度数值+32
 
             String henan = n.item( 0 ).getChildNodes().item( 0 ).getNodeValue();
             Log.i( "省会" , henan);
             String zhengzhou_1 = n.item( 1 ).getChildNodes().item( 0 )
                     .getNodeValue();
             Log.i( "市区" , zhengzhou_1);
             String time_4 = n.item( 4 ).getChildNodes().item( 0 ).getNodeValue();
             Log.i( "时间" , time_4);
             String wendu_5 = n.item( 5 ).getChildNodes().item( 0 ).getNodeValue();
             Log.i( "温度" , wendu_5);
             String duoyun_6 = n.item( 6 ).getChildNodes().item( 0 ).getNodeValue();
             Log.i( "日期" , duoyun_6);
             String weifeng_7 = n.item( 7 ).getChildNodes().item( 0 ).getNodeValue();
             Log.i( "风速" , weifeng_7);
             String picture1_8 = n.item( 8 ).getChildNodes().item( 0 )
                     .getNodeValue();
             Log.i( "图片1" , picture1_8);
             String picture2_9 = n.item( 9 ).getChildNodes().item( 0 )
                     .getNodeValue();
             Log.i( "图片2" , picture2_9);
             String content_10 = n.item( 10 ).getChildNodes().item( 0 )
                     .getNodeValue();
             Log.i( "今天天气描述" , content_10);
             String content2_11 = n.item( 11 ).getChildNodes().item( 0 )
                     .getNodeValue();
             Log.i( "天气小贴士" , content2_11);
 
             String tomrrow_12 = n.item( 12 ).getChildNodes().item( 0 )
                     .getNodeValue();
             Log.i( "明天气温" , tomrrow_12);
             String tomrrow_13 = n.item( 13 ).getChildNodes().item( 0 )
                     .getNodeValue();
             Log.i( "明天概况" , tomrrow_13);
             String tomrrow_14 = n.item( 14 ).getChildNodes().item( 0 )
                     .getNodeValue();
             Log.i( "明天风向和风力" , tomrrow_14);
             String tomrrow_15 = n.item( 15 ).getChildNodes().item( 0 )
                     .getNodeValue();
             Log.i( "明天图片1" , tomrrow_15);
             String tomrrow_16 = n.item( 16 ).getChildNodes().item( 0 )
                     .getNodeValue();
             Log.i( "明天图片2" , tomrrow_16);
 
             String tomrrow2_17 = n.item( 17 ).getChildNodes().item( 0 )
                     .getNodeValue();
             Log.i( "后天气温" , tomrrow2_17);
             String tomrrow2_18 = n.item( 18 ).getChildNodes().item( 0 )
                     .getNodeValue();
             Log.i( "后天概况" , tomrrow2_18);
             String tomrrow2_19 = n.item( 19 ).getChildNodes().item( 0 )
                     .getNodeValue();
             Log.i( "后天风向和风力" , tomrrow2_19);
             String tomrrow2_20 = n.item( 20 ).getChildNodes().item( 0 )
                     .getNodeValue();
             Log.i( "后天图片1" , tomrrow2_20);
             String tomrrow2_21 = n.item( 21 ).getChildNodes().item( 0 )
                     .getNodeValue();
             Log.i( "后天图片2" , tomrrow2_21);
 
             String zonghe_22 = n.item( 22 ).getChildNodes().item( 0 )
                     .getNodeValue();
             Log.i( "介绍 " , zonghe_22);
 
             // 获得图片url 当天的。
             String imgUrl =  "http://www.webxml.com.cn/images/weather/" ;
             String TodayimgUrl1 =  null ;
             TodayimgUrl1 = imgUrl
                     + n.item( 8 ).getChildNodes().item( 0 ).getNodeValue();
             Log.i( "今天的图片1地址" , TodayimgUrl1);
             String TodayimgUrl2 =  null ;
             TodayimgUrl2 = imgUrl
                     + n.item( 9 ).getChildNodes().item( 0 ).getNodeValue();
             Log.i( "今天的图片2地址" , TodayimgUrl2);
             // 今天图片异步加载部分
             // String imrUrl = data.getJSONObject(0).get("imrUrl").toString();
             DownImage loadimage_today_one =  new  DownImage(TodayimgUrl1);
             loadimage_today_one.loadImage( new  ImageCallback() {
 
                 @Override
                 public  void  getDrawable(Drawable drawable) {
                     // TODO Auto-generated method stub
                     imView_today1.setImageDrawable(drawable);
                 }
             });
             DownImage loadimage_today_two =  new  DownImage(TodayimgUrl2);
             loadimage_today_two.loadImage( new  ImageCallback() {
 
                 @Override
                 public  void  getDrawable(Drawable drawable) {
                     // TODO Auto-generated method stub
                     imView_today2.setImageDrawable(drawable);
                 }
             });
             // imView_today1.setImageBitmap(Utils.returnBitMap(TodayimgUrl1));
             // imView_today2.setImageBitmap(Utils.returnBitMap(TodayimgUrl2));
             // 获得图片url 明天的。
             String TomorrowimgUrl1 =  null ;
             TomorrowimgUrl1 = imgUrl
                     + n.item( 8 ).getChildNodes().item( 0 ).getNodeValue();
             Log.i( "明天的图片1地址" , TomorrowimgUrl1);
             String TomorrowimgUrl2 =  null ;
             TomorrowimgUrl2 = imgUrl
                     + n.item( 9 ).getChildNodes().item( 0 ).getNodeValue();
             Log.i( "明天的图片2地址" , TomorrowimgUrl1);
             DownImage loadimage_tomrrow_one =  new  DownImage(TomorrowimgUrl1);
             loadimage_tomrrow_one.loadImage( new  ImageCallback() {
 
                 @Override
                 public  void  getDrawable(Drawable drawable) {
                     // TODO Auto-generated method stub
                     imView_tomrrow1.setImageDrawable(drawable);
                 }
             });
             DownImage loadimage_tomrrow_two =  new  DownImage(TomorrowimgUrl2);
             loadimage_tomrrow_two.loadImage( new  ImageCallback() {
 
                 @Override
                 public  void  getDrawable(Drawable drawable) {
                     // TODO Auto-generated method stub
                     imView_tomrrow2.setImageDrawable(drawable);
                 }
             });
             // imView_tomrrow1.setImageBitmap(Utils.returnBitMap(TomorrowimgUrl1));
             // imView_tomrrow2.setImageBitmap(Utils.returnBitMap(TomorrowimgUrl2));
             // 获得图片url 后天的。
             String NextimgUrl1 =  null ;
             NextimgUrl1 = imgUrl
                     + n.item( 8 ).getChildNodes().item( 0 ).getNodeValue();
             Log.i( "后天的图片1地址" , NextimgUrl1);
             String NextimgUrl2 =  null ;
             NextimgUrl2 = imgUrl
                     + n.item( 9 ).getChildNodes().item( 0 ).getNodeValue();
             Log.i( "后天的图片2地址" , NextimgUrl2);
             DownImage loadimage_next_one =  new  DownImage(NextimgUrl1);
             loadimage_next_one.loadImage( new  ImageCallback() {
 
                 @Override
                 public  void  getDrawable(Drawable drawable) {
                     // TODO Auto-generated method stub
                     imView_next1.setImageDrawable(drawable);
                 }
             });
             DownImage loadimage_next_two =  new  DownImage(NextimgUrl2);
             loadimage_next_two.loadImage( new  ImageCallback() {
 
                 @Override
                 public  void  getDrawable(Drawable drawable) {
                     // TODO Auto-generated method stub
                     imView_next2.setImageDrawable(drawable);
                 }
             });
             // imView_next1.setImageBitmap(Utils.returnBitMap(NextimgUrl1));
             // imView_next2.setImageBitmap(Utils.returnBitMap(NextimgUrl2));
 
             // 今天天气
 
             weather += henan;
             weather +=  "/" ;
             weather += zhengzhou_1;
             weather +=  "\n" ;
             weather += time_4;
             weather +=  "\n" ;
             weather += wendu_5;
             weather +=  "\n" ;
             weather += duoyun_6;
             weather +=  "\n" ;
             weather += weifeng_7;
             weather +=  "\n" ;
             weather += content_10;
             weather +=  "\n" ;
             weather += content2_11;
             weather +=  "\n" ;
             // 明天天气
 
             weather_tomrrow += tomrrow_12;
             weather_tomrrow +=  "\n" ;
             weather_tomrrow += tomrrow_13;
             weather_tomrrow +=  "\n" ;
             weather_tomrrow += tomrrow_14;
             weather_tomrrow +=  "\n" ;
 
             // 后天天气
 
             weather_next += tomrrow2_17;
             weather_next +=  "\n" ;
             weather_next += tomrrow2_18;
             weather_next +=  "\n" ;
             weather_next += tomrrow2_19;
             weather_next +=  "\n" ;
 
             // 地区介绍
             weather_detail += zonghe_22;
             weather_detail +=  "\n" ;
             TvPlace.setText(weather);
             Log.i( "parseed weather->" , weather);
             TvPlace_weather_tomrrow.setText(weather_tomrrow);
             Log.i( "parseed weather_tomrrow->" , weather_tomrrow);
             TvPlace_weather_next.setText(weather_next);
             Log.i( "parseed weather_next->" , weather_next);
             TvPlace_weather_detail.setText(weather_detail);
             Log.i( "parseed weather_detail->" , weather_detail);
             if  (msg.what == IS_FINISH) {
                 dialog.dismiss();
             }
         };
 
     };
 
     /** Called when the activity is first created. */
     @Override
     public  void  onCreate(Bundle savedInstanceState) {
         super .onCreate(savedInstanceState);
         setContentView(R.layout.main);
 
         ETplace = (EditText) findViewById(R.id.place1);
 
         query = (Button) findViewById(R.id.query);
         imView_today1 = (ImageView) findViewById(R.id.myImageView_today1);
         imView_today2 = (ImageView) findViewById(R.id.myImageView_today2);
         imView_tomrrow1 = (ImageView) findViewById(R.id.myImageView_tomrrow1);
         imView_tomrrow2 = (ImageView) findViewById(R.id.myImageView_tomrrow2);
         imView_next1 = (ImageView) findViewById(R.id.myImageView_next1);
         imView_next2 = (ImageView) findViewById(R.id.myImageView_next2);
         TvPlace = (TextView) findViewById(R.id.tvPlace);
         TvPlace_weather_tomrrow = (TextView) findViewById(R.id.tvPlace_weather_tomrrow);
         TvPlace_weather_next = (TextView) findViewById(R.id.tvPlace_weather_next);
         TvPlace_weather_detail = (TextView) findViewById(R.id.tvPlace_weather_detail);
         placeName = (TextView) findViewById(R.id.placeName);
 
         query.setOnClickListener( new  Button.OnClickListener() {
             public  void  onClick(View v) {
                 new  Thread( new  MyThread()).start();
                 dialog.show();
             }
         });
         // 加载提示框
         dialog =  new  ProgressDialog( this );
         dialog.setTitle( "提示" );
         dialog.setMessage( "正在下载,请稍后...." );
         dialog.setCancelable( false );
     }
 
     public  class  MyThread  implements  Runnable {
         @Override
         public  void  run() {
             // TODO Auto-generated method stub
             try  {
                 place = CntoEn.getFullSpell(ETplace.getText().toString());
                 Log.i( "Message->" , place);
                 placeName.setText(place);
 
                 String url =  "http://www.webxml.com.cn/WebServices/WeatherWebService.asmx/getWeatherbyCityName?theCityName="
                         + place;
                 Log.i( "url->" , url);
                 DefaultHttpClient client =  new  DefaultHttpClient();
                 HttpUriRequest req =  new  HttpGet(url);
                 HttpResponse resp = client.execute(req);
                 HttpEntity ent = resp.getEntity();
                 InputStream stream = ent.getContent();
                 DocumentBuilder b = DocumentBuilderFactory.newInstance()
                         .newDocumentBuilder();
                 Document d = b.parse( new  InputSource(stream));
                 NodeList n = d.getElementsByTagName( "string" );
                 Message message = Message.obtain();
                 message.obj = n;
                 message.what = IS_FINISH;
                 handler.sendMessage(message);
             catch  (Exception e) {
                 e.printStackTrace();
             }
         }
     }
}

     图片解析公用类:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package  com.sbs.weather;
 
import  java.net.URL;
 
import  android.graphics.drawable.Drawable;
import  android.os.Handler;
import  android.os.Message;
 
public  class  DownImage {
 
     private  String image_path;
 
     public  DownImage(String image_path) {
         // TODO Auto-generated constructor stub
         this .image_path = image_path;
     }
 
     public  void  loadImage( final  ImageCallback callback) {
         final  Handler handler =  new  Handler() {
             @Override
             public  void  handleMessage(android.os.Message msg) {
                 super .handleMessage(msg);
                 callback.getDrawable((Drawable) msg.obj);
             };
         };
         new  Thread( new  Runnable() {
 
             @Override
             public  void  run() {
                 // TODO Auto-generated method stub
                 try  {
                     Drawable drawable = Drawable.createFromStream( new  URL(
                             image_path).openStream(),  "" );
                     // callback.getDrawable(drawable);
                     Message message = Message.obtain();
                     message.obj = drawable;
                     handler.sendMessage(message);
                 catch  (Exception e) {
                     // TODO: handle exception
                     e.printStackTrace();
                 }
             }
         }).start();
     }
 
     // 接口回调方式
     public  interface  ImageCallback {
         public  void  getDrawable(Drawable drawable);
     }
}

     汉字转拼音公用类:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
package  com.sbs.weather;
 
import  java.util.Iterator;
import  java.util.LinkedHashMap;
import  java.util.Set;
 
/**
 
  汉字转化为全拼
 
  * JDK版本: 1.4
  */
public  class  CntoEn {
     private  static  LinkedHashMap spellMap =  null ;
 
     static  {
         if  (spellMap ==  null ) {
             spellMap =  new  LinkedHashMap( 400 );
         }
         initialize();
         System.out.println( "Chinese   transfer   Spell   Done." );
     }
 
     private  static  void  spellPut(String spell,  int  ascii) {
         spellMap.put(spell,  new  Integer(ascii));
     }
 
     private  static  void  initialize() {
         spellPut( "a" , - 20319 );
         spellPut( "ai" , - 20317 );
         spellPut( "an" , - 20304 );
         spellPut( "ang" , - 20295 );
         spellPut( "ao" , - 20292 );
         spellPut( "ba" , - 20283 );
         spellPut( "bai" , - 20265 );
         spellPut( "ban" , - 20257 );
         spellPut( "bang" , - 20242 );
         spellPut( "bao" , - 20230 );
         spellPut( "bei" , - 20051 );
         spellPut( "ben" , - 20036 );
         spellPut( "beng" , - 20032 );
         spellPut( "bi" , - 20026 );
         spellPut( "bian" , - 20002 );
         spellPut( "biao" , - 19990 );
         spellPut( "bie" , - 19986 );
         spellPut( "bin" , - 19982 );
         spellPut( "bing" , - 19976 );
         spellPut( "bo" , - 19805 );
         spellPut( "bu" , - 19784 );
         spellPut( "ca" , - 19775 );
         spellPut( "cai" , - 19774 );
         spellPut( "can" , - 19763 );
         spellPut( "cang" , - 19756 );
         spellPut( "cao" , - 19751 );
         spellPut( "ce" , - 19746 );
         spellPut( "ceng" , - 19741 );
         spellPut( "cha" , - 19739 );
         spellPut( "chai" , - 19728 );
         spellPut( "chan" , - 19725 );
         spellPut( "chang" , - 19715 );
         spellPut( "chao" , - 19540 );
         spellPut( "che" , - 19531 );
         spellPut( "chen" , - 19525 );
         spellPut( "cheng" , - 19515 );
         spellPut( "chi" , - 19500 );
         spellPut( "chong" , - 19484 );
         spellPut( "chou" , - 19479 );
         spellPut( "chu" , - 19467 );
         spellPut( "chuai" , - 19289 );
         spellPut( "chuan" , - 19288 );
         spellPut( "chuang" , - 19281 );
         spellPut( "chui" , - 19275 );
         spellPut( "chun" , - 19270 );
         spellPut( "chuo" , - 19263 );
         spellPut( "ci" , - 19261 );
         spellPut( "cong" , - 19249 );
         spellPut( "cou" , - 19243 );
         spellPut( "cu" , - 19242 );
         spellPut( "cuan" , - 19238 );
         spellPut( "cui" , - 19235 );
         spellPut( "cun" , - 19227 );
         spellPut( "cuo" , - 19224 );
         spellPut( "da" , - 19218 );
         spellPut( "dai" , - 19212 );
         spellPut( "dan" , - 19038 );
         spellPut( "dang" , - 19023 );
         spellPut( "dao" , - 19018 );
         spellPut( "de" , - 19006 );
         spellPut( "deng" , - 19003 );
         spellPut( "di" , - 18996 );
         spellPut( "dian" , - 18977 );
         spellPut( "diao" , - 18961 );
         spellPut( "die" , - 18952 );
         spellPut( "ding" , - 18783 );
         spellPut( "diu" , - 18774 );
         spellPut( "dong" , - 18773 );
         spellPut( "dou" , - 18763 );
         spellPut( "du" , - 18756 );
         spellPut( "duan" , - 18741 );
         spellPut( "dui" , - 18735 );
         spellPut( "dun" , - 18731 );
         spellPut( "duo" , - 18722 );
         spellPut( "e" , - 18710 );
         spellPut( "en" , - 18697 );
         spellPut( "er" , - 18696 );
         spellPut( "fa" , - 18526 );
         spellPut( "fan" , - 18518 );
         spellPut( "fang" , - 18501 );
         spellPut( "fei" , - 18490 );
         spellPut( "fen" , - 18478 );
         spellPut( "feng" , - 18463 );
         spellPut( "fo" , - 18448 );
         spellPut( "fou" , - 18447 );
         spellPut( "fu" , - 18446 );
         spellPut( "ga" , - 18239 );
         spellPut( "gai" , - 18237 );
         spellPut( "gan" , - 18231 );
         spellPut( "gang" , - 18220 );
         spellPut( "gao" , - 18211 );
         spellPut( "ge" , - 18201 );
         spellPut( "gei" , - 18184 );
         spellPut( "gen" , - 18183 );
         spellPut( "geng" , - 18181 );
         spellPut( "gong" , - 18012 );
         spellPut( "gou" , - 17997 );
         spellPut( "gu" , - 17988 );
         spellPut( "gua" , - 17970 );
         spellPut( "guai" , - 17964 );
         spellPut( "guan" , - 17961 );
         spellPut( "guang" , - 17950 );
         spellPut( "gui" , - 17947 );
         spellPut( "gun" , - 17931 );
         spellPut( "guo" , - 17928 );
         spellPut( "ha" , - 17922 );
         spellPut( "hai" , - 17759 );
         spellPut( "han" , - 17752 );
         spellPut( "hang" , - 17733 );
         spellPut( "hao" , - 17730 );
         spellPut( "he" , - 17721 );
         spellPut( "hei" , - 17703 );
         spellPut( "hen" , - 17701 );
         spellPut( "heng" , - 17697 );
         spellPut( "hong" , - 17692 );
         spellPut( "hou" , - 17683 );
         spellPut( "hu" , - 17676 );
         spellPut( "hua" , - 17496 );
         spellPut( "huai" , - 17487 );
         spellPut( "huan" , - 17482 );
         spellPut( "huang" , - 17468 );
         spellPut( "hui" , - 17454 );
         spellPut( "hun" , - 17433 );
         spellPut( "huo" , - 17427 );
         spellPut( "ji" , - 17417 );
         spellPut( "jia" , - 17202 );
         spellPut( "jian" , - 17185 );
         spellPut( "jiang" , - 16983 );
         spellPut( "jiao" , - 16970 );
         spellPut( "jie" , - 16942 );
         spellPut( "jin" , - 16915 );
         spellPut( "jing" , - 16733 );
         spellPut( "jiong" , - 16708 );
         spellPut( "jiu" , - 16706 );
         spellPut( "ju" , - 16689 );
         spellPut( "juan" , - 16664 );
         spellPut( "jue" , - 16657 );
         spellPut( "jun" , - 16647 );
         spellPut( "ka" , - 16474 );
         spellPut( "kai" , - 16470 );
         spellPut( "kan" , - 16465 );
         spellPut( "kang" , - 16459 );
         spellPut( "kao" , - 16452 );
         spellPut( "ke" , - 16448 );
 
         spellPut( "ken" , - 16433 );
         spellPut( "keng" , - 16429 );
         spellPut( "kong" , - 16427 );
         spellPut( "kou" , - 16423 );
         spellPut( "ku" , - 16419 );
         spellPut( "kua" , - 16412 );
         spellPut( "kuai" , - 16407 );
         spellPut( "kuan" , - 16403 );
         spellPut( "kuang" , - 16401 );
         spellPut( "kui" , - 16393 );
         spellPut( "kun" , - 16220 );
         spellPut( "kuo" , - 16216 );
         spellPut( "la" , - 16212 );
         spellPut( "lai" , - 16205 );
         spellPut( "lan" , - 16202 );
         spellPut( "lang" , - 16187 );
         spellPut( "lao" , - 16180 );
         spellPut( "le" , - 16171 );
         spellPut( "lei" , - 16169 );
         spellPut( "leng" , - 16158 );
         spellPut( "li" , - 16155 );
         spellPut( "lia" , - 15959 );
         spellPut( "lian" , - 15958 );
         spellPut( "liang" , - 15944 );
         spellPut( "liao" , - 15933 );
         spellPut( "lie" , - 15920 );
         spellPut( "lin" , - 15915 );
         spellPut( "ling" , - 15903 );
         spellPut( "liu" , -