class TranslatorImp implements Translator {

	public List<Verbal> fixPos(List<Verbal> verbals) {
		for(int i = 0; i < verbals.size(); i++) {
			if(verbals.get(i).getPartOfSpeech() != null) {
				if(verbals.get(i).getPartOfSpeech().contains(StableData.NLP_ZI_DONG)){
					if(!verbals.get(i).getPartOfSpeech().contains(StableData.NLP_ZI_MING)){
						if(i - StableData.INT_ONE > StableData.INT_ZERO && verbals.get(i - StableData.INT_ONE)
								.getEnglish().contains(StableData.NLP_ENGLISH_OF)) {
							Verbal temp = verbals.get(i);
							temp.setPartOfSpeech(StableData.NLP_CI_DONG_MING);
							String english = temp.getEnglish().replace(StableData.SPACE_STRING, StableData.EMPTY_STRING);
							if(english.charAt(english.length() - StableData.INT_ONE) == StableData.NLP_CHAR_E) {
								english = StableData.NLP_ENGLISH_THE + StableData.SPACE_STRING 
										+ english.substring(StableData.INT_ZERO, english.length() - StableData.INT_ONE) 
										+ StableData.NLP_ENGLISH_ING;
							}else {
								english = StableData.NLP_ENGLISH_THE + StableData.SPACE_STRING + english + StableData.NLP_ENGLISH_ING;
							}
							temp.setEnglish(english);
						}else if(verbals.get(i + StableData.INT_ONE).getPartOfSpeech().contains(StableData.NLP_ZI_MING)){
							if(i - StableData.INT_ONE >= StableData.INT_ZERO && !verbals.get(i - StableData.INT_ONE).getPartOfSpeech()
									.contains(StableData.NLP_ZI_MING)){
								if(!verbals.get(i - StableData.INT_ONE).getPartOfSpeech().contains(StableData.NLP_ZI_DAI)){
									if(verbals.get(i - StableData.INT_ONE).getPartOfSpeech().contains(StableData.NLP_ZI_JIE)){
										if(verbals.get(i - StableData.INT_ONE).getChinese().contains(StableData.NLP_ZI_ZAI)){
											if(verbals.get(i + StableData.INT_ONE).getChinese().contains(StableData.NLP_ZI_ZHONG)){
												Verbal temp = verbals.get(i + StableData.INT_ONE);
												temp.setEnglish(StableData.NLP_ENGLISH_STATUS);
											}
										}
									}
									Verbal temp = verbals.get(i);
									temp.setPartOfSpeech(StableData.NLP_CI_DONG_MING);
									String english = temp.getEnglish().replace(StableData.SPACE_STRING, StableData.EMPTY_STRING);
									if(english.charAt(english.length()-StableData.INT_ONE) == StableData.NLP_CHAR_E) {
										english = StableData.NLP_ENGLISH_THE + StableData.SPACE_STRING 
												+ english.substring(StableData.INT_ZERO, english.length() - StableData.INT_ONE) 
												+ StableData.NLP_ENGLISH_ING;
									}else {
										english = StableData.NLP_ENGLISH_THE + StableData.SPACE_STRING + english + StableData.NLP_ENGLISH_ING;
									}
									temp.setEnglish(english);
								}
							}
							if(verbals.get(i + StableData.INT_TWO).getPartOfSpeech().contains(StableData.NLP_ZI_DONG)){
								if(!verbals.get(i + StableData.INT_TWO).getPartOfSpeech().contains(StableData.NLP_ZI_MING)){
									if(verbals.get(i + StableData.INT_THREE).getPartOfSpeech().contains(StableData.NLP_ZI_MING)){
										Verbal temp = verbals.get(i + StableData.INT_TWO);
										temp.setPartOfSpeech(StableData.NLP_CI_DONG_MING);
										String english = temp.getEnglish().replace(StableData.SPACE_STRING, StableData.EMPTY_STRING);
										if(english.charAt(english.length() - StableData.INT_ONE) == StableData.NLP_CHAR_E) {
											english = StableData.NLP_ENGLISH_OF + StableData.SPACE_STRING +
													StableData.NLP_ENGLISH_THE + StableData.SPACE_STRING 
													+ english.substring(StableData.INT_ZERO, english.length()-StableData.INT_ONE) 
													+ StableData.NLP_ENGLISH_ING;
										}else {
											english = StableData.NLP_ENGLISH_OF + StableData.SPACE_STRING +
													StableData.NLP_ENGLISH_THE + StableData.SPACE_STRING + english + StableData.NLP_ENGLISH_ING;
										}
										temp.setEnglish(english);
									}
								}
							}
						}else if(i - StableData.INT_ONE >= StableData.INT_ZERO && verbals.get(i - StableData.INT_ONE)
								.getPartOfSpeech().contains(StableData.NLP_ZI_JIE)){
							Verbal temp = verbals.get(i);
							temp.setPartOfSpeech(StableData.NLP_CI_DONG_MING);
							String english = temp.getEnglish().replace(StableData.SPACE_STRING, StableData.EMPTY_STRING);
							if(english.charAt(english.length() - StableData.INT_ONE) == StableData.NLP_CHAR_E) {
								english = StableData.NLP_ENGLISH_THE + StableData.SPACE_STRING + english.substring(StableData.INT_ZERO
										, english.length() - StableData.INT_ONE) + StableData.NLP_ENGLISH_ING;
							}else {
								english = StableData.NLP_ENGLISH_THE + StableData.SPACE_STRING  + english + StableData.NLP_ENGLISH_ING;
							}
							temp.setEnglish(english);
						}else if(i - StableData.INT_ONE >= StableData.INT_ZERO && verbals.get(i - StableData.INT_ONE).getPartOfSpeech()
								.contains(StableData.NLP_ZI_FU)){
							Verbal temp = verbals.get(i);
							temp.setPartOfSpeech(StableData.NLP_CI_DONG_MING);
							String english = temp.getEnglish().replace(StableData.SPACE_STRING, StableData.EMPTY_STRING);
							if(english.charAt(english.length() - StableData.INT_ONE) == StableData.NLP_CHAR_E) {
								english = english.substring(StableData.INT_ZERO, english.length() - StableData.INT_ONE) 
										+ StableData.NLP_ENGLISH_ING;
							}else {
								english += StableData.NLP_ENGLISH_ING;
							}
							temp.setEnglish(english);
						}
					}
				}else if(verbals.get(i).getPartOfSpeech().contains(StableData.NLP_ZI_MING)){
					if(i - StableData.INT_ONE >= StableData.INT_ZERO && verbals.get(i - StableData.INT_ONE)
							.getPartOfSpeech().contains(StableData.NLP_FU_SHU)){
						Verbal temp = verbals.get(i);
						String english = temp.getEnglish().replace(StableData.SPACE_STRING, StableData.EMPTY_STRING);
						if(english.charAt(english.length()-1) == StableData.NLP_CHAR_H || english.charAt(english.length()-1) 
								== StableData.NLP_CHAR_S) {
							english += StableData.NLP_ENGLISH_ES;
						}else {
							english += StableData.NLP_ENGLISH_S;
						}
						temp.setEnglish(english);
					}
				}else if(verbals.get(i).getPartOfSpeech().contains(StableData.NLP_CI_FU)){
					if(i - StableData.INT_ONE >= StableData.INT_ZERO && (verbals.get(i-StableData.INT_ONE)
							.getPartOfSpeech().contains(StableData.NLP_ZI_DAI)
							||verbals.get(i - StableData.INT_ONE).getPartOfSpeech().contains(StableData.NLP_ZI_MING))){
						if(i-StableData.INT_ONE >= StableData.INT_ZERO&&verbals.get(i - StableData.INT_ONE).getPartOfSpeech()
								.contains(StableData.NLP_ZI_复)
								||(verbals.get(i-StableData.INT_ONE).getPartOfSpeech().contains(StableData.NLP_ZI_单)
										&& verbals.get(i-StableData.INT_ONE).getPartOfSpeech().contains(StableData.NLP_ZI_一))){
							if(verbals.get(i).getEnglish().contains(StableData.NLP_HAVE_HAS)) {
								Verbal temp = verbals.get(i);
								String english = temp.getEnglish().replace(StableData.NLP_HAVE_HAS, StableData.NLP_HAVE);
								temp.setEnglish(english);
							}
						}else {
							if(verbals.get(i).getEnglish().contains(StableData.NLP_HAVE_HAS)) {
								Verbal temp = verbals.get(i);
								String english = temp.getEnglish().replace(StableData.NLP_HAVE_HAS, StableData.NLP_HAS);
								temp.setEnglish(english);
							}
						}
					}	
					if(i-StableData.INT_TWO>= StableData.INT_ZERO && (verbals.get(i-StableData.INT_TWO).getPartOfSpeech()
							.contains(StableData.NLP_ZI_DAI) || verbals.get(i-StableData.INT_TWO).getPartOfSpeech()
							.contains(StableData.NLP_ZI_MING))){
						if(verbals.get(i-StableData.INT_TWO).getPartOfSpeech().contains(StableData.NLP_ZI_复)
								||(verbals.get(i-StableData.INT_TWO).getPartOfSpeech().contains(StableData.NLP_ZI_单)
										&&verbals.get(i-StableData.INT_TWO).getPartOfSpeech().contains(StableData.NLP_ZI_一))){
							if(verbals.get(i).getEnglish().contains(StableData.NLP_HAVE_HAS)) {
								Verbal temp = verbals.get(i);
								String english = temp.getEnglish().replace(StableData.NLP_HAVE_HAS, StableData.NLP_HAVE);
								temp.setEnglish(english);
							}
						}else {
							if(verbals.get(i).getEnglish().contains(StableData.NLP_HAVE_HAS)) {
								Verbal temp = verbals.get(i);
								String english = temp.getEnglish().replace(StableData.NLP_HAVE_HAS, StableData.NLP_HAS);
								temp.setEnglish(english);
							}
						}
					}	 
				}	
			}
		}
		return verbals;
	}

}