Index: /WAeUP_SRP/base/skins/waeup_utilities/ti_441_resolve_part2.py
===================================================================
--- /WAeUP_SRP/base/skins/waeup_utilities/ti_441_resolve_part2.py	(revision 2996)
+++ /WAeUP_SRP/base/skins/waeup_utilities/ti_441_resolve_part2.py	(revision 2997)
@@ -16,4 +16,5 @@
     def set_trace():
         pass
+
 
 mtool = context.portal_membership
@@ -39,26 +40,28 @@
     response.write("%s<br>\n\r" % s)
 
-def getLGAs():
-    voc = getattr(context.portal_vocabularies,'local_gov_areas')
-    states = []
-    lgas  = []
-    d = {}
-    for k,v in voc.items():
-        parts = v.split(' / ')
-        if len(parts) == 1:
-            state = parts[0].lower()
-            lga = ""
-        elif len(parts) == 2:
-            state = parts[0].lower()
-            lga = "_".join(parts[1].lower().split())
-        else:
-            continue
-        if state not in states:
-            states.append(state)
-        if lga not in lgas:
-            lgas.append(lga)
-        d[k] = v
-    return (d,states,lgas)
+# def getLGAs():
+#     voc = getattr(context.portal_vocabularies,'local_gov_areas')
+#     states = []
+#     lgas  = []
+#     d = {}
+#     for k,v in voc.items():
+#         parts = v.split(' / ')
+#         if len(parts) == 1:
+#             state = parts[0].lower()
+#             lga = ""
+#         elif len(parts) == 2:
+#             state = parts[0].lower()
+#             lga = "_".join(parts[1].lower().split())
+#         else:
+#             continue
+#         if state not in states:
+#             states.append(state)
+#         if lga not in lgas:
+#             lgas.append(lga)
+#         d[k] = v
+#     return (d,states,lgas)
 
+difference = context.waeup_tool.difference
+re_split = context.waeup_tool.re_split
 #logger.info('')
 student_records = context.students_catalog()
@@ -68,53 +71,54 @@
 commit_after = 100
 logger.info('started to fix %d records in students_catalog' % total)
-d,states,lgas = getLGAs()
+mapping = context.waeup_tool.getStatesLgas()
+states = mapping['states']
+lgas = mapping['lgas']
+words_dict = mapping['word_dict']
 d = {}
 for student_record in student_records:
     # skip record without lga value
+    count += 1
     if not student_record.lga:
         continue
-    #skip records with correct lga key value
-    if student_record.lga.find('_') > -1:
-        continue
+    # if student_record.lga.find(' ') < 0:
+    #     continue
     if student_record.lga.startswith('no state'):
-        logger.info("found invalid lga %s of %s" % (student_record.lga,student_record.id))
+        #logger.info("found invalid lga %s of %s" % (student_record.lga,student_record.id))
         continue
     #rwrite("%s: %s" % (student_record.id,student_record.lga))
-    sl = student_record.lga.split(' / ')
-    if len(sl) != 2:
-        sl = student_record.lga.split('/')
-        if len(sl) != 2:
-            logger.info("found invalid lga %s of %s" % (student_record.lga,student_record.id))
-            #rwrite("wrong size %s: %s" % (student_record.id,sl))
-            continue
-    state = sl[0].lower().strip()
-    lga = sl[1].lower().strip()
-    if not lga or not state:
-        logger.info("found invalid lga %s of %s" % (student_record.lga,student_record.id))
-        continue
-    count += 1
-    if len(d) and not len(d)  % commit_after:
-        logger.info("found %d correct state/lga combinations of %d so far" % (len(d),count))
-    if state in states:
-        found = False
-        while True:
-            if lga in lgas:
-                found = True
+    words = student_record.lga 
+    if len(words.split(' / ')) == 2:
+        words = words.replace(' / ',' ')
+    words = re_split('[^a-zA-Z0-9/]',words)
+    lga_words = []
+    for word in words:
+        if word:
+            lga_words += word.lower(),
+    lga_words.sort()
+    # state = sl[0].lower().strip()
+    # state = '_'.join(state.split())
+    # lga = sl[1].lower().strip()
+    # if not lga or not state:
+    #     logger.info("found invalid lga %s of %s" % (student_record.lga,student_record.id))
+    #     continue
+    state_lga = ''
+    while not state_lga:
+        for k,l in words_dict.items():
+            if lga_words == l:
+                state_lga = k
                 break
-            lga = lga.replace(' ','-')
-            if lga in lgas:
-                found = True
-            break
-        if found:
-            #msg = "found %s for %s" % (state_lga,student_record.id)
-            state_lga = state + '_' + lga
+        break
+    if state_lga:
+        if state_lga != student_record.lga:
+            msg = "found %s is %s for %s " % (state_lga,student_record.lga,student_record.id)
+            #rwrite(msg)
             d[student_record.id] = state_lga
-        #else:
-            #msg = "no '%s' '%s' for %s" % (state,lga,student_record.id)
-            #rwrite(msg)
-    #else:
-        #msg = "no state '%s' '%s' for %s" % (state,lga,student_record.id)
-        #rwrite(msg)
-    # if count > 150:
+            if len(d) and not len(d)  % commit_after:
+                logger.info("found %d to correct state/lga combinations of %d so far" % (len(d),count))
+        else:
+            msg = "already corrected %s : %s for %s " % (state_lga,student_record.lga,student_record.id)
+    else:
+        msg = "no '%s' for %s" % (lga_words,student_record.id)
+    # if count > 2000:
     #     break
 to_edit = len(d)
Index: /WAeUP_SRP/uniben/profiles/default/vocabularies/local_gov_areas.xml
===================================================================
--- /WAeUP_SRP/uniben/profiles/default/vocabularies/local_gov_areas.xml	(revision 2996)
+++ /WAeUP_SRP/uniben/profiles/default/vocabularies/local_gov_areas.xml	(revision 2997)
@@ -13,6 +13,6 @@
     <item key="abia_ikawuno" msgid="">Abia / Ikawuno</item>
     <item key="abia_ikwuano" msgid="">Abia / Ikwuano</item>
-    <item key="abia_isiala-ngwa_north" msgid="">Abia / Isiala-Ngwa North</item>
-    <item key="abia_isiala-ngwa_south" msgid="">Abia / Isiala-Ngwa South</item>
+    <item key="abia_isiala-ngwa-north" msgid="">Abia / Isiala-Ngwa-North</item>
+    <item key="abia_isiala-ngwa-south" msgid="">Abia / Isiala-Ngwa-South</item>
     <item key="abia_isikwuato" msgid="">Abia / Isikwuato</item>
     <item key="abia_isuikwuato" msgid="">Abia / Isuikwuato</item>
@@ -111,5 +111,5 @@
     <item key="anambra_oti" msgid="">Anambra / Oti</item>
     <item key="anambra_oyi" msgid="">Anambra / Oyi</item>
-    <item key="anambra_ubuluizor_ihiala" msgid="">Anambra / Ubuluizor Ihiala</item>
+    <item key="anambra_ubuluizor-ihiala" msgid="">Anambra / Ubuluizor-Ihiala</item>
     <item key="anambra_uyi" msgid="">Anambra / Uyi</item>
     <item key="bauchi_alkaleri" msgid="">Bauchi / Alkaleri</item>
@@ -214,5 +214,4 @@
     <item key="cross_river_yakurr" msgid="">Cross River / Yakurr</item>
     <item key="cross_river_yala" msgid="">Cross River / Yala</item>
-    <item key="delta_aniocha_north" msgid="">Delta / Aniocha North</item>
     <item key="delta_aniocha-north" msgid="">Delta / Aniocha-North</item>
     <item key="delta_aniocha-south" msgid="">Delta / Aniocha-South</item>
@@ -226,5 +225,5 @@
     <item key="delta_ika-north-east" msgid="">Delta / Ika-North-East</item>
     <item key="delta_ika-south" msgid="">Delta / Ika-South</item>
-    <item key="delta_ikpemili" msgid="">Delta / Ikpemili</item>
+    <item key="delta_idemili-south" msgid="">Delta / Idemili-South</item>
     <item key="delta_isoko-north" msgid="">Delta / Isoko-North</item>
     <item key="delta_isoko-south" msgid="">Delta / Isoko-South</item>
@@ -234,4 +233,5 @@
     <item key="delta_ndokwa-west" msgid="">Delta / Ndokwa-West</item>
     <item key="delta_okpe" msgid="">Delta / Okpe</item>
+    <item key="delta_okwuani" msgid="">Delta / Okwuani</item>
     <item key="delta_oleh" msgid="">Delta / Oleh</item>
     <item key="delta_oshielli-north" msgid="">Delta / Oshielli-North</item>
@@ -275,9 +275,9 @@
     <item key="edo_afuze" msgid="">Edo / Afuze</item>
     <item key="edo_agbazilo" msgid="">Edo / Agbazilo</item>
-    <item key="edo_akoko_edo" msgid="">Edo / Akoko Edo</item>
     <item key="edo_akoko-edo" msgid="">Edo / Akoko-Edo</item>
     <item key="edo_egor" msgid="">Edo / Egor</item>
     <item key="edo_esan-central" msgid="">Edo / Esan-Central</item>
     <item key="edo_esan-north-east" msgid="">Edo / Esan-North-East</item>
+    <item key="edo_esan-north-west" msgid="">Edo / Esan-North-West</item>
     <item key="edo_esan-south-east" msgid="">Edo / Esan-South-East</item>
     <item key="edo_esan-west" msgid="">Edo / Esan-West</item>
@@ -291,8 +291,7 @@
     <item key="edo_opoji_irrua" msgid="">Edo / Opoji Irrua</item>
     <item key="edo_oredo" msgid="">Edo / Oredo</item>
-    <item key="edo_orhionmwon" msgid="">Edo / Orhionmwon</item>
+    <item key="edo_ohionmwon" msgid="">Edo / Ohionmwon</item>
     <item key="edo_ovia-north-east" msgid="">Edo / Ovia-North-East</item>
     <item key="edo_ovia-south-west" msgid="">Edo / Ovia-South-West</item>
-    <item key="edo_owan_east" msgid="">Edo / Owan East</item>
     <item key="edo_owan-east" msgid="">Edo / Owan-East</item>
     <item key="edo_owan-west" msgid="">Edo / Owan-West</item>
@@ -663,4 +662,5 @@
     <item key="ondo_akoko-south" msgid="">Ondo / Akoko-South</item>
     <item key="ondo_akoko-south-east" msgid="">Ondo / Akoko-South-East</item>
+    <item key="ondo_akoko-south-west" msgid="">Ondo / Akoko-South-West</item>
     <item key="ondo_akure" msgid="">Ondo / Akure</item>
     <item key="ondo_akure-north" msgid="">Ondo / Akure-North</item>
@@ -678,4 +678,5 @@
     <item key="ondo_ondo" msgid="">Ondo / Ondo</item>
     <item key="ondo_ondo-east" msgid="">Ondo / Ondo-East</item>
+    <item key="ondo_ondo-west" msgid="">Ondo / Ondo-West</item>
     <item key="ondo_ose" msgid="">Ondo / Ose</item>
     <item key="ondo_owo" msgid="">Ondo / Owo</item>
@@ -687,10 +688,10 @@
     <item key="osun_boripe" msgid="">Osun / Boripe</item>
     <item key="osun_ede" msgid="">Osun / Ede</item>
-    <item key="osun_ede_north" msgid="">Osun / Ede North</item>
+    <item key="osun_ede-north" msgid="">Osun / Ede North</item>
     <item key="osun_egbedore" msgid="">Osun / Egbedore</item>
     <item key="osun_ejigbo" msgid="">Osun / Ejigbo</item>
     <item key="osun_ife" msgid="">Osun / Ife</item>
-    <item key="osun_ife_north" msgid="">Osun / Ife North</item>
-    <item key="osun_ife_south" msgid="">Osun / Ife South</item>
+    <item key="osun_ife-north" msgid="">Osun / Ife-North</item>
+    <item key="osun_ife-south" msgid="">Osun / Ife-South</item>
     <item key="osun_ife-central" msgid="">Osun / Ife-Central</item>
     <item key="osun_ife-east" msgid="">Osun / Ife-East</item>
@@ -867,5 +868,4 @@
     <item key="bayelsa_southern-ijaw" msgid="">Bayelsa / Southern-Ijaw</item>
     <item key="akwa_ibom_ibiono-ibom" msgid="">Akwa Ibom / Ibiono-Ibom</item>
-    <item key="delta_idemili-south" msgid="">Delta / Idemili-South</item>
     <item key="oyo_itesiwaju" msgid="">Oyo / Itesiwaju</item>
     <item key="kogi_mopa-muro" msgid="">Kogi / Mopa-Muro</item>
