src/main/java/org/wltea/analyzer/dic/DictSegment.java
private DictSegment lookforSegment(Character keyChar ,  int create){
		
		DictSegment ds = null;

		if(this.storeSize <= ARRAY_LENGTH_LIMIT){
			//获取数组容器，如果数组未创建则创建数组
			DictSegment[] segmentArray = getChildrenArray();			
			//搜寻数组
			DictSegment keySegment = new DictSegment(keyChar);
			int position = Arrays.binarySearch(segmentArray, 0 , this.storeSize, keySegment);
			if(position >= 0){
				ds = segmentArray[position];
			}
		
			//遍历数组后没有找到对应的segment
			if(ds == null && create == 1){
				ds = keySegment;
				if(this.storeSize < ARRAY_LENGTH_LIMIT){
					//数组容量未满，使用数组存储
					segmentArray[this.storeSize] = ds;
					//segment数目+1
					this.storeSize++;
					Arrays.sort(segmentArray , 0 , this.storeSize);
					
				}else{
					//数组容量已满，切换Map存储
					//获取Map容器，如果Map未创建,则创建Map
					Map<Character , DictSegment> segmentMap = getChildrenMap();
					//将数组中的segment迁移到Map中
					migrate(segmentArray ,  segmentMap);
					//存储新的segment
					segmentMap.put(keyChar, ds);
					//segment数目+1 ，  必须在释放数组前执行storeSize++ ， 确保极端情况下，不会取到空的数组
					this.storeSize++;
					//释放当前的数组引用
					this.childrenArray = null;
				}

			}			
			
		}else{
			//获取Map容器，如果Map未创建,则创建Map
			Map<Character , DictSegment> segmentMap = getChildrenMap();
			//搜索Map
			ds = (DictSegment)segmentMap.get(keyChar);
			if(ds == null && create == 1){
				//构造新的segment
				ds = new DictSegment(keyChar);
				segmentMap.put(keyChar , ds);
				//当前节点存储segment数目+1
				this.storeSize ++;
			}
		}

		return ds;
	}
private DictSegment lookforSegment(Character keyChar ,  int create){
		
		DictSegment ds = null;

		if(this.storeSize <= ARRAY_LENGTH_LIMIT){
			//获取数组容器，如果数组未创建则创建数组
			DictSegment[] segmentArray = getChildrenArray();			
			//搜寻数组
			DictSegment keySegment = new DictSegment(keyChar);
			int position = Arrays.binarySearch(segmentArray, 0 , this.storeSize, keySegment);
			if(position >= 0){
				ds = segmentArray[position];
			}
		
			//遍历数组后没有找到对应的segment
			if(ds == null && create == 1){
				ds = keySegment;
				if(this.storeSize < ARRAY_LENGTH_LIMIT){
					//数组容量未满，使用数组存储
					segmentArray[this.storeSize] = ds;
					//segment数目+1
					this.storeSize++;
					Arrays.sort(segmentArray , 0 , this.storeSize);
					
				}else{
					//数组容量已满，切换Map存储
					//获取Map容器，如果Map未创建,则创建Map
					Map<Character , DictSegment> segmentMap = getChildrenMap();
					//将数组中的segment迁移到Map中
					migrate(segmentArray ,  segmentMap);
					//存储新的segment
					segmentMap.put(keyChar, ds);
					//segment数目+1 ，  必须在释放数组前执行storeSize++ ， 确保极端情况下，不会取到空的数组
					this.storeSize++;
					//释放当前的数组引用
					this.childrenArray = null;
				}

			}			
			
		}else{
			//获取Map容器，如果Map未创建,则创建Map
			Map<Character , DictSegment> segmentMap = getChildrenMap();
			//搜索Map
			ds = (DictSegment)segmentMap.get(keyChar);
			if(ds == null && create == 1){
				//构造新的segment
				ds = new DictSegment(keyChar);
				segmentMap.put(keyChar , ds);
				//当前节点存储segment数目+1
				this.storeSize ++;
			}
		}

		return ds;
	}
private DictSegment lookforSegment ( Character keyChar , int create ) { DictSegment ds = null ; if ( this . storeSize <= ARRAY_LENGTH_LIMIT ) { //获取数组容器，如果数组未创建则创建数组 DictSegment [ ] segmentArray = getChildrenArray ( ) ; //搜寻数组 DictSegment keySegment = new DictSegment ( keyChar ) ; int position = Arrays . binarySearch ( segmentArray , 0 , this . storeSize , keySegment ) ; if ( position >= 0 ) { ds = segmentArray [ position ] ; } //遍历数组后没有找到对应的segment if ( ds == null && create == 1 ) { ds = keySegment ; if ( this . storeSize < ARRAY_LENGTH_LIMIT ) { //数组容量未满，使用数组存储 segmentArray [ this . storeSize ] = ds ; //segment数目+1 this . storeSize ++ ; Arrays . sort ( segmentArray , 0 , this . storeSize ) ; } else { //数组容量已满，切换Map存储 //获取Map容器，如果Map未创建,则创建Map Map < Character , DictSegment > segmentMap = getChildrenMap ( ) ; //将数组中的segment迁移到Map中 migrate ( segmentArray , segmentMap ) ; //存储新的segment segmentMap . put ( keyChar , ds ) ; //segment数目+1 ，  必须在释放数组前执行storeSize++ ， 确保极端情况下，不会取到空的数组 this . storeSize ++ ; //释放当前的数组引用 this . childrenArray = null ; } } } else { //获取Map容器，如果Map未创建,则创建Map Map < Character , DictSegment > segmentMap = getChildrenMap ( ) ; //搜索Map ds = ( DictSegment ) segmentMap . get ( keyChar ) ; if ( ds == null && create == 1 ) { //构造新的segment ds = new DictSegment ( keyChar ) ; segmentMap . put ( keyChar , ds ) ; //当前节点存储segment数目+1 this . storeSize ++ ; } } return ds ; }
查找本节点下对应的keyChar的segment	 *
@param keyChar
@param create  =1如果没有找到，则创建新的segment ; =0如果没有找到，不创建，返回null
@return
查找本节点下对应的keyChar的segment *