Subversion Repositories SmartDukaan

Rev

Rev 5566 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5566 Rev 5600
Line 60... Line 60...
60
		categorySynonyms.put((long) 10018, Arrays.asList(catSynonyms.get("Carrying Case").split(",")));
60
		categorySynonyms.put((long) 10018, Arrays.asList(catSynonyms.get("Carrying Case").split(",")));
61
		this.entities = entities;
61
		this.entities = entities;
62
	}
62
	}
63
	
63
	
64
	public void generate()	{
64
	public void generate()	{
65
		Map<String,Map<String, String>> map = new HashMap<String, Map<String,String>>();
65
		Map<String,List<List<String>>> map = new HashMap<String, List<List<String>>>();
66
		for(Entity entity: entities)	{
66
		for(Entity entity: entities)	{
67
			
67
			
68
			long categoryId = entity.getCategoryID();
68
			long categoryId = entity.getCategoryID();
69
			String url = getProductURL(entity);
69
			String url = getProductURL(entity);
70
			
70
			
Line 78... Line 78...
78
					if(text.indexOf("<ul>") > -1)	continue;
78
					if(text.indexOf("<ul>") > -1)	continue;
79
					for(String name: getHandsetNames(text))	{
79
					for(String name: getHandsetNames(text))	{
80
						for(String categoryLabel : getCategorySynonyms(categoryId)){
80
						for(String categoryLabel : getCategorySynonyms(categoryId)){
81
							String displayName = name + " " + categoryLabel;
81
							String displayName = name + " " + categoryLabel;
82
							String startsWith = displayName.substring(0,1).toLowerCase();
82
							String startsWith = displayName.substring(0,1).toLowerCase();
83
							Map <String, String> map1;
83
							List<List<String>> list1;
84
							if(map.containsKey(startsWith)){
84
							if(map.containsKey(startsWith)){
85
								map1 = map.get(startsWith);
85
								list1 = map.get(startsWith);
86
							}else {
86
							}else {
87
								map1 = new HashMap<String, String>();
87
								list1 = new ArrayList<List<String>>();
88
								map.put(startsWith, map1);
88
								map.put(startsWith, list1);
89
							}
89
							}
90
							map1.put(displayName, url);
90
							list1.add(Arrays.asList(displayName, url));
91
						}
91
						}
92
					}
92
					}
93
					
93
					
94
				} catch (NullPointerException e) {
94
				} catch (NullPointerException e) {
95
					// TODO: handle exception
95
					// TODO: handle exception