Index: /other-projects/maori-lang-detection/src/org/greenstone/atea/NutchTextDumpToMongoDB.java
===================================================================
--- /other-projects/maori-lang-detection/src/org/greenstone/atea/NutchTextDumpToMongoDB.java	(revision 33810)
+++ /other-projects/maori-lang-detection/src/org/greenstone/atea/NutchTextDumpToMongoDB.java	(revision 33811)
@@ -74,6 +74,5 @@
     
     private String geoLocationCountryCode = null; /** 2 letter country code */
-    private boolean urlContainsLangCodeInPathSuffix = false; /** If any URL on this site contains a /mi(/) in its URL */
-    private boolean urlContainsLangCodeInPathPrefix = false; /** If any URL on this site contains a http(s)://mi.* in its URL */
+    private boolean urlContainsLangCodeInPath = false; /** If any URL on this site contains a /mi(/) or http(s)://mi.* in its URL path */
     
     private String domainOfSite;
@@ -208,18 +207,8 @@
 	}
 	
-	/*	    
-	// for every site, we just need to work out if any of its pages
-	// contains /mi(/) in its URL
+	/* No need to loop again through all pages. Instead, just inspectPageURLPath() as each page is created above.
+	// For any site, we just need to work out if any of its pages contains /mi(/) or http(s)://mi.* in its URL path
 	for(TextDumpPage aPage : pages) {
-	    String url = aPage.getPageURL();
-	    logger.debug("@@@@ pageURL: " + url);
-	    if(!this.urlContainsLangCodeInPathSuffix && (url.contains("/mi/") || url.endsWith("/mi"))) {
-		this.urlContainsLangCodeInPathSuffix = true;
-		logger.info("*********** URL CONTAINS SUFFIX");
-	    }
-	    // And if any contains http(s)://mi. in its URL
-	    if(!this.urlContainsLangCodeInPathPrefix && (url.startsWith("https://mi.") || url.startsWith("http://mi."))) {
-		this.urlContainsLangCodeInPathPrefix = true;
-	    }
+	    inspectPageURLPath(aPage);
 	}
 	*/
@@ -233,11 +222,9 @@
 	//logger.debug("@@@@ pageURL: " + url);
 	
-	// check if each page in site contains /mi(/) in URL, and if so set a site-level variable accordingly
-	if(!this.urlContainsLangCodeInPathSuffix && (url.contains("/mi/") || url.endsWith("/mi"))) {
-	    this.urlContainsLangCodeInPathSuffix = true;
-	}
-	// And if any page contains http(s)://mi. in its URL, then set site level variable for this accordingly
-	if(!this.urlContainsLangCodeInPathPrefix && (url.startsWith("https://mi.") || url.startsWith("http://mi."))) {
-	    this.urlContainsLangCodeInPathPrefix = true;
+	if(!this.urlContainsLangCodeInPath) { // if not already set to true for any previous page in this site,
+	    // check if this page of the site contains /mi(/) or http(s)://mi in its URL path
+	    if(url.contains("/mi/") || url.endsWith("/mi") || url.startsWith("https://mi.") || url.startsWith("http://mi.")) {
+		this.urlContainsLangCodeInPath = true;
+	    }
 	}
     }
@@ -356,5 +343,5 @@
 	      this.numPagesInMRI, this.numPagesContainingMRI,
 	      this.siteCrawledTimestamp, this.siteCrawlUnfinished, redoCrawl,
-	      this.geoLocationCountryCode, this.urlContainsLangCodeInPathSuffix, this.urlContainsLangCodeInPathPrefix);
+	      this.geoLocationCountryCode, this.urlContainsLangCodeInPath);
 
 	//mongodbAccess.insertWebsiteInfo(website);
Index: /other-projects/maori-lang-detection/src/org/greenstone/atea/morphia/WebsiteInfo.java
===================================================================
--- /other-projects/maori-lang-detection/src/org/greenstone/atea/morphia/WebsiteInfo.java	(revision 33810)
+++ /other-projects/maori-lang-detection/src/org/greenstone/atea/morphia/WebsiteInfo.java	(revision 33811)
@@ -21,6 +21,5 @@
     
     public final String geoLocationCountryCode;
-    public final boolean urlContainsLangCodeInPathSuffix;
-    public final boolean urlContainsLangCodeInPathPrefix;
+    public final boolean urlContainsLangCodeInPath;
 	
     public WebsiteInfo(/*int siteCount,*/ String siteFolderName, String domainOfSite,
@@ -28,5 +27,5 @@
 		       int numPagesInMRI, int numPagesContainingMRI,
 		       long siteCrawledTimestamp, boolean siteCrawlUnfinished, boolean redoCrawl,
-		       String geoLocationCountryCode, boolean urlContainsLangCodeInPathSuffix, boolean urlContainsLangCodeInPathPrefix)
+		       String geoLocationCountryCode, boolean urlContainsLangCodeInPath)
     {
 	//this.id = siteCount;
@@ -45,6 +44,5 @@
 	
 	this.geoLocationCountryCode = geoLocationCountryCode;
-	this.urlContainsLangCodeInPathSuffix = urlContainsLangCodeInPathSuffix;
-	this.urlContainsLangCodeInPathPrefix = urlContainsLangCodeInPathPrefix;
+	this.urlContainsLangCodeInPath = urlContainsLangCodeInPath;
     }
 }
