cjk 0.2.5

Answer Boolean Questions and Queries about CJK and related character sets
Documentation
use cjk::*;

#[test]
fn radical1() {
   assert_eq!(UNIHAN_RADICALS.len(), 214);
}

#[test]
fn radical2() {
   assert_eq!(UNIHAN_RADICALS.get(&1).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&2).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&3).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&4).unwrap().point, '丿'); 
   assert_eq!(UNIHAN_RADICALS.get(&5).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&6).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&7).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&8).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&9).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&10).unwrap().point, ''); 

   assert_eq!(UNIHAN_RADICALS.get(&11).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&12).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&13).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&14).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&15).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&16).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&17).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&18).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&19).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&20).unwrap().point, ''); 

   assert_eq!(UNIHAN_RADICALS.get(&21).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&22).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&23).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&24).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&25).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&26).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&27).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&28).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&29).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&30).unwrap().point, ''); 

   assert_eq!(UNIHAN_RADICALS.get(&31).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&32).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&33).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&34).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&35).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&36).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&37).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&38).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&39).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&40).unwrap().point, ''); 

   assert_eq!(UNIHAN_RADICALS.get(&41).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&42).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&43).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&44).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&45).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&46).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&47).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&48).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&49).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&50).unwrap().point, ''); 

   assert_eq!(UNIHAN_RADICALS.get(&51).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&52).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&53).unwrap().point, '广'); 
   assert_eq!(UNIHAN_RADICALS.get(&54).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&55).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&56).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&57).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&58).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&59).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&60).unwrap().point, ''); 

   assert_eq!(UNIHAN_RADICALS.get(&61).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&62).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&63).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&64).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&65).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&66).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&67).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&68).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&69).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&70).unwrap().point, ''); 

   assert_eq!(UNIHAN_RADICALS.get(&71).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&72).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&73).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&74).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&75).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&76).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&77).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&78).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&79).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&80).unwrap().point, ''); 

   assert_eq!(UNIHAN_RADICALS.get(&81).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&82).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&83).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&84).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&85).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&86).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&87).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&88).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&89).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&90).unwrap().point, ''); 

   assert_eq!(UNIHAN_RADICALS.get(&91).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&92).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&93).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&94).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&95).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&96).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&97).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&98).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&99).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&100).unwrap().point, ''); 

   assert_eq!(UNIHAN_RADICALS.get(&101).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&102).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&103).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&104).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&105).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&106).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&107).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&108).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&109).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&110).unwrap().point, ''); 

   assert_eq!(UNIHAN_RADICALS.get(&111).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&112).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&113).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&114).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&115).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&116).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&117).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&118).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&119).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&120).unwrap().point, ''); 

   assert_eq!(UNIHAN_RADICALS.get(&121).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&122).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&123).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&124).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&125).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&126).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&127).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&128).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&129).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&130).unwrap().point, ''); 

   assert_eq!(UNIHAN_RADICALS.get(&131).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&132).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&133).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&134).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&135).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&136).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&137).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&138).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&139).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&140).unwrap().point, ''); 

   assert_eq!(UNIHAN_RADICALS.get(&141).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&142).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&143).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&144).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&145).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&146).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&147).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&148).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&149).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&150).unwrap().point, ''); 

   assert_eq!(UNIHAN_RADICALS.get(&151).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&152).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&153).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&154).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&155).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&156).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&157).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&158).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&159).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&160).unwrap().point, ''); 

   assert_eq!(UNIHAN_RADICALS.get(&161).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&162).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&163).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&164).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&165).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&166).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&167).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&168).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&169).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&170).unwrap().point, ''); 

   assert_eq!(UNIHAN_RADICALS.get(&171).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&172).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&173).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&174).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&175).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&176).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&177).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&178).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&179).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&180).unwrap().point, ''); 

   assert_eq!(UNIHAN_RADICALS.get(&181).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&182).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&183).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&184).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&185).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&186).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&187).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&188).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&189).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&190).unwrap().point, ''); 

   assert_eq!(UNIHAN_RADICALS.get(&191).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&192).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&193).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&194).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&195).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&196).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&197).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&198).unwrap().point, '鹿'); 
   assert_eq!(UNIHAN_RADICALS.get(&199).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&200).unwrap().point, ''); 

   assert_eq!(UNIHAN_RADICALS.get(&201).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&202).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&203).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&204).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&205).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&206).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&207).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&208).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&209).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&210).unwrap().point, ''); 

   assert_eq!(UNIHAN_RADICALS.get(&211).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&212).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&213).unwrap().point, ''); 
   assert_eq!(UNIHAN_RADICALS.get(&214).unwrap().point, ''); 
}

#[test]
fn radical3() {
   assert_eq!(UNIHAN_RADICALS.get(&1).unwrap().variants, vec!['']);
}

#[test]
fn radical4() {
   for (_,ch) in UNIHAN_CHARACTERS.iter() {
      assert!(ch.radicals.iter().all(|r| r.radical_stroke_count>0));
   }
}