Return-Path: X-Original-To: apmail-incubator-ambari-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-ambari-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 69A98F045 for ; Thu, 30 May 2013 00:36:35 +0000 (UTC) Received: (qmail 38024 invoked by uid 500); 30 May 2013 00:36:35 -0000 Delivered-To: apmail-incubator-ambari-commits-archive@incubator.apache.org Received: (qmail 38004 invoked by uid 500); 30 May 2013 00:36:35 -0000 Mailing-List: contact ambari-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@incubator.apache.org Delivered-To: mailing list ambari-commits@incubator.apache.org Received: (qmail 37996 invoked by uid 99); 30 May 2013 00:36:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 May 2013 00:36:35 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 May 2013 00:36:29 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 210952388C79; Thu, 30 May 2013 00:34:53 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: svn commit: r1487690 [36/38] - in /incubator/ambari/site/1.2.3: ./ installing-hadoop-using-ambari/ installing-hadoop-using-ambari/common/ installing-hadoop-using-ambari/common/css/ installing-hadoop-using-ambari/common/images/ installing-hadoop-using-a... Date: Thu, 30 May 2013 00:34:44 -0000 To: ambari-commits@incubator.apache.org From: yusaku@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130530003453.210952388C79@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Added: incubator/ambari/site/1.2.3/installing-hadoop-using-ambari/content/search/index-3.js URL: http://svn.apache.org/viewvc/incubator/ambari/site/1.2.3/installing-hadoop-using-ambari/content/search/index-3.js?rev=1487690&view=auto ============================================================================== --- incubator/ambari/site/1.2.3/installing-hadoop-using-ambari/content/search/index-3.js (added) +++ incubator/ambari/site/1.2.3/installing-hadoop-using-ambari/content/search/index-3.js Thu May 30 00:34:39 2013 @@ -0,0 +1,396 @@ +//Auto generated index for searching. +w["password-less"]="24,43,66"; +w["past"]="66"; +w["path"]="0,14,44,66"; +w["patient"]="54"; +w["pay"]="25"; +w["pdsh"]="50"; +w["peer"]="20"; +w["peerport"]="20"; +w["peopl"]="75"; +w["per"]="36,54,66"; +w["perform"]="0,6,14,23,32,41,57,66,70"; +w["perman"]="40"; +w["permiss"]="24,40"; +w["phase"]="44"; +w["php-common"]="57"; +w["php-common-5"]="57"; +w["physic"]="70"; +w["pid"]="11,42"; +w["pig"]="3,30,32,70"; +w["place"]="55,71"; +w["platform"]="0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77"; +w["pleas"]="50,54"; +w["plot"]="56"; +w["plugin"]="51"; +w["pluginconf"]="47"; +w["point"]="12,14,42,55,73"; +w["polici"]="40"; +w["pop-up"]="54"; +w["popup"]="58"; +w["port"]="3,8,15,20,30,31,48,53,68,74,75,77"; +w["port_numb"]="77"; +w["possibl"]="22,40"; +w["postgresql"]="18,19,44,45,64"; +w["postgresql-init"]="64"; +w["postgresql-lib"]="64"; +w["postgresql-serv"]="64"; +w["potenti"]="30"; +w["pre-instal"]="57"; +w["prepar"]="13,43,69"; +w["preselect"]="58"; +w["present"]="25"; +w["previous"]="32,39,51,55"; +w["primaryurl"]="75"; +w["print"]="0,40"; +w["prior"]="9"; +w["privat"]="24,66"; +w["privileg"]="42,51,75"; +w["problem"]="1,2,6,8,9,11,16,28,29,35,37,49,50,51,55,56,57,59,64,65"; +w["proceed"]="28"; +w["process"]="6,7,8,9,11,16,26,34,36,44,48,51,54,55,69,70,71"; +w["produc"]="29,55,71"; +w["product"]="14"; +w["program"]="55,70"; +w["programat"]="30"; +w["progress"]="54"; +w["prompt"]="0,44"; +w["proper"]="14,16,32,37"; +w["properti"]="13,20,25,36,55,71,75,77"; +w["protect"]="40"; +w["protocol"]="3,7,15,16,20,30,31,68,74"; +w["provid"]="7,12,14,29,46,66,70,75"; +w["proxi"]="50"; +w["ps"]="6,11,34"; +w["pub"]="24"; +w["public"]="14,24,66"; +w["public-repo-1"]="32,39,46,55"; +w["pull"]="50"; +w["purpos"]="70"; +w["push"]="35"; +w["put"]="7,13,66"; +w["python"]="50,59"; +w["python26"]="64"; +w["python26-lib"]="64"; +w["qualifi"]="42"; +w["queri"]="70"; +w["quick"]="7"; +w["r"]="30"; +w["ram"]="21"; +w["random"]="70"; +w["rang"]="66"; +w["rather"]="66"; +w["re-launch"]="9"; +w["re-login"]="9"; +w["re-regist"]="11"; +w["re-run"]="28,37"; +w["re-start"]="9,28,55,75,77"; +w["read"]="29,75"; +w["readi"]="12"; +w["reason"]="25"; +w["reboot"]="7,40,49"; +w["recent"]="1,55"; +w["recommend"]="1,36,40,50"; +w["reconfigur"]="70"; +w["recurs"]="13"; +w["red"]="25,48,50"; +w["redhat6"]="14"; +w["reduc"]="36"; +w["reflect"]="6,51"; +w["refresh"]="29,55"; +w["refresh-packagekit"]="47"; +w["region"]="8,20,36,48"; +w["regionserv"]="20,36,48"; +w["regist"]="10,41,60,66"; +w["registr"]="41,66"; +w["reinstal"]="51"; +w["relat"]="14,25,54,70"; +w["releas"]="50"; +w["rememb"]="36"; +w["remot"]="24"; +w["remov"]="11,21,26,32,57,64"; +w["renam"]="32,55,71"; +w["replac"]="32,39,55"; +w["replic"]="7"; +w["repo"]="14,18,19,32,39,45,46,50,55,60,71"; +w["repoid"]="14"; +w["repoinfo"]="14,55,71"; +w["repolist"]="18,45"; +w["reponam"]="14"; +w["report"]="28,32"; +w["repositori"]="0,14,18,19,29,32,33,39,45,46,50,55,57,66,71"; +w["requir"]="1,7,23,25,36,46,50,51,70"; +w["reset"]="28"; +w["resolv"]="29,55,71"; +w["resourc"]="0,14,55,71"; +w["respect"]="48"; +w["respons"]="9,28"; +w["rest"]="8,48,70,77"; +w["restart"]="1,11,16,32,40,49,51,55"; +w["result"]="13"; +w["retain"]="24,32"; +w["retri"]="28"; +w["retriev"]="14"; +w["return"]="9,63"; +w["revers"]="4,16"; +w["review"]="63"; +w["rhel"]="1,14,18,32,39,45,46,47,50,55,60,64,71"; +w["right"]="21"; +w["rightscal"]="57"; +w["rightscale-epel"]="57"; +w["roll"]="32"; +w["root"]="13,24,46,75"; +w["root@"]="24"; +w["rpm"]="14,32,46,50,55,71"; +w["rpms"]="50"; +w["rpmsave"]="32,55,71"; +w["rrdtool"]="64"; +w["rubygem"]="50"; +w["run"]="0,5,6,7,11,13,14,20,24,27,30,32,35,40,44,48,50,54,55,56,64,65,69,70,71,75,76,77"; +w["runjar"]="51"; +w["s"]="13,20,28,32,36,42,70"; +w["safari"]="50"; +w["safe"]="13,32,55,71"; +w["safemod"]="32"; +w["same"]="8,9,36,48"; +w["satisfi"]="21,26,48,63"; +w["save"]="13,14,39,55,71"; +w["scenario"]="36"; +w["schedul"]="70"; +w["schema"]="51,55,71"; +w["scp"]="50"; +w["screen"]="9,25,26,28,41,54,63"; +w["script"]="41,70"; +w["se"]="32"; +w["search"]="75"; +w["secondari"]="31,75"; +w["secondarynamenod"]="32"; +w["secondaryurl"]="75"; +w["section"]="12,13,32,41,44,46,54,58,61,66,67,69"; +w["secur"]="1,31,40,66,75"; +w["secured_url_port"]="10,60"; +w["see"]="0,1,6,14,18,19,20,24,25,26,32,39,44,45,46,48,50,51,54,55,58,66,70,71"; +w["select"]="13,21,26,29,41,48,54,55,58,66,70"; +w["selinux"]="40,43,44"; +w["selinuxtyp"]="40"; +w["send"]="13,64"; +w["separ"]="49"; +w["sequenc"]="28,70"; +w["serv"]="46"; +w["server"]="0,1,3,5,6,7,8,10,11,13,14,15,16,20,24,28,29,30,31,32,34,36,39,41,44,46,48,49,50,55,57,60,61,64,68,70,71,73,74,75,77"; +w["server2"]="30"; +w["servic"]="1,3,6,7,12,13,15,20,21,25,28,29,30,31,32,36,37,54,55,56,58,68,70,73,74,75"; +w["set"]="7,8,14,20,24,25,33,36,39,40,42,43,44,46,48,50,55,66,70,71,72,75,77"; +w["setenforc"]="40"; +w["setup"]="0,14,24,28,44"; +w["sh"]="8,32,41,48"; +w["shell"]="6,7"; +w["shift"]="55"; +w["ship"]="50,59"; +w["should"]="6,14,18,19,22,23,29,32,45,55,71,75,77"; +w["show"]="11,21,54,56"; +w["shown"]="54"; +w["shuffl"]="3"; +w["silent"]="0"; +w["similar"]="1,55,71"; +w["simpl"]="54"; +w["singl"]="22,26,50"; +w["situat"]="33"; +w["size"]="36"; +w["skip"]="44,61"; +w["slave"]="3,7,20,22,31,48,68"; +w["sles"]="10,19,29,32,39,46,47,50,55,64,71"; +w["slight"]="25"; +w["slot"]="36"; +w["small"]="26"; +w["smoke"]="1,16,51,75"; +w["so"]="14,25,35,40,55,64,75"; +w["softwar"]="14,28,33,46,50,65,66"; +w["solut"]="1,2,6,8,9,11,16,28,29,35,37,49,51,56,57,59,65"; +w["solvabl"]="29"; +w["some"]="14,26,29,33,55,56,65,70,75"; +w["someth"]="14,28"; +w["sourc"]="70"; +w["sp1"]="50"; +w["special"]="38,70"; +w["specif"]="23,47,48,54,62"; +w["specifi"]="0,3,16,31,51,53"; +w["sql"]="30,70"; +w["sqoop"]="32,70"; +w["ssh"]="24,28,43,66"; +w["ssh-keygen"]="24"; +w["ssl"]="75"; +w["stabl"]="50"; +w["stack"]="12,14,32,55,61,71"; +w["standard"]="30,70"; +w["stanza"]="14"; +w["start"]="6,7,8,9,10,11,28,32,34,48,49,54,55,56,60,73,75,77"; +w["startup"]="51"; +w["state"]="6,13,40"; +w["status"]="2,3,7,31,32,54,75"; +w["step"]="13,14,23,32,38,44,47,55,71"; +w["still"]="61"; +w["stop"]="6,7,13,34,39,52,55,75"; +w["storag"]="32"; +w["store"]="13,42,70,75"; +w["strict"]="40"; +w["strong"]="25,40"; +w["structur"]="32,70"; +w["submiss"]="3"; +w["submit"]="3"; +w["substitut"]="32"; +w["success"]="32,54,55,71"; +w["such"]="23,25,35,39,55"; +w["sudo"]="32,46"; +w["suggest"]="25,36"; +w["summari"]="17,55"; +w["suppli"]="66"; +w["support"]="3,16,20,31,37,42,50,65,70"; +w["sure"]="7,13,14,16,23,24,26,32,36,39,51,53,55,58,63,65,71,72"; +w["suse"]="50,59"; +w["suse11"]="32,39,46,55"; +w["susecloud"]="29"; +w["sync"]="2"; +w["synchron"]="7,76"; +w["system"]="1,4,13,14,23,31,32,36,40,42,49,50,65,66,70"; +w["tab"]="13,25"; +w["tabl"]="0,3,15,20,30,31,41,46,53,68,74,75"; +w["take"]="23,29,36,40,54,55,71"; +w["taken"]="32"; +w["talk"]="20"; +w["target"]="24,40,66"; +w["task"]="3,17,36,54"; +w["tasktrack"]="36,48"; +w["task­track"]="3"; +w["team"]="3,20,31"; +w["templeton"]="15,70"; +w["temporarili"]="40,44"; +w["test"]="1,9,16,28,32,51,54,75"; +w["text"]="1,38,41,47,51,66,75,77"; +w["than"]="1,11,64,66"; +w["their"]="14"; +w["them"]="26,58,66"; +w["then"]="7"; +w["there"]="14,23,25,29,32,36,39,50,51,55"; +w["these"]="13,23,25,30,40,50,66,75"; +w["they"]="16,26,75"; +w["thing"]="5"; +w["thorough"]="32"; +w["those"]="1,25,26,32"; +w["thread"]="1"; +w["three"]="22,23,40,70"; +w["thrift"]="30"; +w["through"]="30,32,66,73,76"; +w["thrown"]="51"; +w["time"]="7,50,56,75,77"; +w["tmp"]="13,41"; +w["tool"]="30,50,58,70"; +w["top"]="15,54"; +w["track"]="32"; +w["tracker"]="3"; +w["transact"]="55,71"; +w["transfer"]="31"; +w["tri"]="7,29"; +w["troubl"]="5,49"; +w["troubleshoot"]="27"; +w["true"]="75"; +w["tweak"]="25"; +w["two"]="14,22,25,51"; +w["type"]="7,14,22,25,28,38,40,42"; +w["typic"]="3,20,31"; +w["ui"]="3,13,20,30,31"; +w["uid"]="75"; +w["ulimit"]="1"; +w["umask"]="7,43,72"; +w["unabl"]="1,4,6,37,50,65"; +w["unavail"]="50"; +w["understand"]="58,70"; +w["uninstal"]="32"; +w["unknown"]="51"; +w["unknownhostexcept"]="51"; +w["unless"]="32,47"; +w["unrecover"]="13"; +w["unselect"]="58"; +w["until"]="32,56"; +w["up"]="7,13,14,20,24,32,33,39,42,43,44,46,55,58,66,70,71,75"; +w["updat"]="14,23,29,32,35,39,44,50,55,71"; +w["upgrad"]="13,23,29,32,39,55,59,61,71"; +w["upgradestack"]="71"; +w["uri"]="3,30,31"; +w["url_port"]="10,60"; +w["usag"]="36"; +w["use"]="0,1,3,7,8,9,12,13,14,15,16,18,19,20,22,23,24,25,28,29,30,31,32,36,38,40,41,42,44,45,46,48,50,51,54,55,57,58,61,63,64,66,67,68,70,71,73,74,75,77"; +w["user"]="3,12,13,15,20,30,31,32,37,42,51,55,68,70,71,74,75"; +w["usernam"]="42,44,51,73,75"; +w["usernameattribut"]="75"; +w["usessl"]="75"; +w["usr"]="0,8,32,48"; +w["usual"]="30,32"; +w["util"]="14,15,18,19,30,45,51"; +w["v"]="44,60"; +w["v0"]="32"; +w["v1"]="32"; +w["v3"]="32"; +w["v5"]="50,64"; +w["v6"]="1,64"; +w["valid"]="0,66"; +w["valu"]="0,1,14,40,41,43,72,75,77"; +w["var"]="0,5,11,14,51,55,71"; +w["variabl"]="30"; +w["various"]="3,20,21,30,31,42,68,74"; +w["vendor"]="29"; +w["verbos"]="0"; +w["version"]="18,19,23,24,32,39,45,50,54,55,59,61,64,65,71"; +w["versus"]="32"; +w["vi"]="10,14,40,60"; +w["via"]="77"; +w["view"]="7,13,28,32,55,56,75"; +w["vista"]="50"; +w["volum"]="70"; +w["want"]="14,18,19,20,24,33,45,46,58,66"; +w["warn"]="0,24,26,40,44,55,58"; +w["way"]="2,28"; +w["web"]="2,3,6,7,8,13,15,20,31,32,37,48,50,55,75,76,77"; +w["web-bas"]="24"; +w["webhcat"]="15,32,70"; +w["webhcat-tar"]="32"; +w["webui"]="3,31"; +w["welcom"]="38"; +w["were"]="26"; +w["wget"]="26,32,39,46,50,55"; +w["whatev"]="41,73"; +w["whether"]="75"; +w["which"]="2,20,24,42,46,48,50,53,54,55,58,59,76"; +w["while"]="22,55"; +w["white"]="26"; +w["whitespac"]="38"; +w["window"]="50"; +w["wish"]="21,38,41,42,61,63,66,73,75,77"; +w["within"]="59"; +w["wizard"]="9,12,14,21,24,25,28,33,37,42,44,48,50,66,67,73"; +w["work"]="70"; +w["workaround"]="29"; +w["workflow"]="70"; +w["would"]="14,36"; +w["x"]="1,18,19,32,39,45,46,50,55,60"; +w["x-1"]="46"; +w["x86"]="57"; +w["x86_64"]="18,45,55,71"; +w["xml"]="14,55,71"; +w["y"]="44"; +w["yast"]="32"; +w["yellow"]="26"; +w["yes"]="3,15,20,24,30,31"; +w["yet"]="13,32"; +w["you"]="0,1,2,4,5,6,7,8,9,12,13,14,16,17,18,19,20,21,22,23,24,25,26,27,32,33,36,37,38,39,41,42,43,44,45,46,47,48,49,50,51,53,54,55,58,61,62,63,65,66,70,71,73,75,76,77"; +w["your"]="0,1,2,4,7,9,10,12,13,14,16,21,24,25,26,27,28,32,33,36,39,40,41,42,43,44,46,48,49,50,51,55,57,58,60,61,63,64,65,66,67,70,73,76,77"; +w["yourself"]="25"; +w["yum"]="18,32,39,45,46,47,50,55,57,60,65,71"; +w["zoo"]="20"; +w["zookeep"]="20,21,32,42,70"; +w["zookeeper-3"]="32"; +w["zypp"]="32,39,46,55"; +w["zypper"]="10,19,29,32,55,71"; +w["~"]="24"; +w["–j"]="0,14"; + Added: incubator/ambari/site/1.2.3/installing-hadoop-using-ambari/content/search/ja-jp.props URL: http://svn.apache.org/viewvc/incubator/ambari/site/1.2.3/installing-hadoop-using-ambari/content/search/ja-jp.props?rev=1487690&view=auto ============================================================================== --- incubator/ambari/site/1.2.3/installing-hadoop-using-ambari/content/search/ja-jp.props (added) +++ incubator/ambari/site/1.2.3/installing-hadoop-using-ambari/content/search/ja-jp.props Thu May 30 00:34:39 2013 @@ -0,0 +1 @@ +J01=\\u306B \ No newline at end of file Added: incubator/ambari/site/1.2.3/installing-hadoop-using-ambari/content/search/nwSearchFnt.js URL: http://svn.apache.org/viewvc/incubator/ambari/site/1.2.3/installing-hadoop-using-ambari/content/search/nwSearchFnt.js?rev=1487690&view=auto ============================================================================== --- incubator/ambari/site/1.2.3/installing-hadoop-using-ambari/content/search/nwSearchFnt.js (added) +++ incubator/ambari/site/1.2.3/installing-hadoop-using-ambari/content/search/nwSearchFnt.js Thu May 30 00:34:39 2013 @@ -0,0 +1,555 @@ +/*---------------------------------------------------------------------------- + * JavaScript for webhelp search + *---------------------------------------------------------------------------- + This file is part of the webhelpsearch plugin for DocBook WebHelp + Copyright (c) 2007-2008 NexWave Solutions All Rights Reserved. + www.nexwave.biz Nadege Quaine + http://kasunbg.blogspot.com/ Kasun Gajasinghe + */ + +//string initialization +var htmlfileList = "htmlFileList.js"; +var htmlfileinfoList = "htmlFileInfoList.js"; +var useCJKTokenizing = false; + +/* Cette fonction verifie la validite de la recherche entrre par l utilisateur */ +function Verifie(ditaSearch_Form) { + + // Check browser compatibitily + if (navigator.userAgent.indexOf("Konquerer") > -1) { + + alert(txt_browser_not_supported); + return; + } + + + var expressionInput = document.ditaSearch_Form.textToSearch.value.replace(/["',;]/g,' '); + //Set a cookie to store the searched keywords + $.cookie('textToSearch', expressionInput); + + + if (expressionInput.length < 1) { + + // expression is invalid + alert(txt_enter_at_least_1_char); + // reactive la fenetre de search (utile car cadres) + document.ditaSearch_Form.textToSearch.focus(); + } + else { + + // Effectuer la recherche + Effectuer_recherche(expressionInput); + + //Track with Google Analytics: + _gaq.push(['_trackEvent', 'Search', expressionInput, 'null', 1]); + + + // reactive la fenetre de search (utile car cadres) + document.ditaSearch_Form.textToSearch.focus(); + } +} + +var stemQueryMap = new Array(); // A hashtable which maps stems to query words + +/* This function parses the search expression, loads the indices and displays the results*/ +function Effectuer_recherche(expressionInput) { + + /* Display a waiting message */ + //DisplayWaitingMessage(); + + /*data initialisation*/ + var searchFor = ""; // expression en lowercase et sans les caracte res speciaux + //w = new Object(); // hashtable, key=word, value = list of the index of the html files + scriptLetterTab = new Scriptfirstchar(); // Array containing the first letter of each word to look for + var wordsList = new Array(); // Array with the words to look for + var finalWordsList = new Array(); // Array with the words to look for after removing spaces + var linkTab = new Array(); + var fileAndWordList = new Array(); + var txt_wordsnotfound = ""; + + + /*nqu: expressionInput, la recherche est lower cased, plus remplacement des char speciaux*/ + //The original replacement expression is: + //searchFor = expressionInput.toLowerCase().replace(/<\//g, "_st_").replace(/\$_/g, "_di_").replace(/\.|%2C|%3B|%21|%3A|@|\/|\*/g, " ").replace(/(%20)+/g, " ").replace(/_st_/g, "= 0; i--) { + if (fileAndWordList[i] != undefined) { + linkTab.push("

" + txt_results_for + " " + "" + fileAndWordList[i][0].motslisteDisplay + "" + "

"); + + linkTab.push("
    "); + for (t in fileAndWordList[i]) { + //DEBUG: alert(": "+ fileAndWordList[i][t].filenb+" " +fileAndWordList[i][t].motsliste); + //linkTab.push("
  • "+fl[fileAndWordList[i][t].filenb]+"
  • "); + var tempInfo = fil[fileAndWordList[i][t].filenb]; + var pos1 = tempInfo.indexOf("@@@"); + var pos2 = tempInfo.lastIndexOf("@@@"); + var tempPath = tempInfo.substring(0, pos1); + var tempTitle = tempInfo.substring(pos1 + 3, pos2); + var tempShortdesc = tempInfo.substring(pos2 + 3, tempInfo.length); + + //file:///home/kasun/docbook/WEBHELP/webhelp-draft-output-format-idea/src/main/resources/web/webhelp/installation.html + var linkString = "
  • " + tempTitle + ""; + // var linkString = "
  • " + tempTitle + ""; + if ((tempShortdesc != "null")) { + linkString += "\n
    " + tempShortdesc + "
    "; + } + linkString += "
  • "; + linkTab.push(linkString); + } + linkTab.push("
"); + } + } + } + + var results = ""; + if (linkTab.length > 0) { + /*writeln ("

" + txt_results_for + " " + "" + cleanwordsList + "" + "
"+"

");*/ + results = "

"; + //write("

    "); + for (t in linkTab) { + results += linkTab[t].toString(); + } + results += "

    "; + } else { + results = "

    " + "Your search returned no results for " + "" + txt_wordsnotfound + "" + "

    "; + } + //alert(results); + document.getElementById('searchResults').innerHTML = results; +} + +function tokenize(wordsList){ + var stemmedWordsList = new Array(); // Array with the words to look for after removing spaces + var cleanwordsList = new Array(); // Array with the words to look for + + + for(var j=0;j"; + return this.input.substring(this.offset,this.offset+2); + } + + function getAllTokens(){ + while(this.incrementToken()){ + var tmp = this.tokenize(); + this.tokens.push(tmp); + } + return this.unique(this.tokens); +// document.getElementById("content").innerHTML += tokens+" "; +// document.getElementById("content").innerHTML += "
    dada"+sortedTokens+" "; +// console.log(tokens.length+"dsdsds"); + /*for(i=0;i t2.length) { + return 1; + } else { + return -1; + } + //return t1.length - t2.length); +} \ No newline at end of file Added: incubator/ambari/site/1.2.3/installing-hadoop-using-ambari/content/search/punctuation.props URL: http://svn.apache.org/viewvc/incubator/ambari/site/1.2.3/installing-hadoop-using-ambari/content/search/punctuation.props?rev=1487690&view=auto ============================================================================== --- incubator/ambari/site/1.2.3/installing-hadoop-using-ambari/content/search/punctuation.props (added) +++ incubator/ambari/site/1.2.3/installing-hadoop-using-ambari/content/search/punctuation.props Thu May 30 00:34:39 2013 @@ -0,0 +1,31 @@ +Punct01=\\u3002 +Punct02=\\u3003 +Punct03=\\u300C +Punct04=\\u300D +Punct05=\\u300E +Punct06=\\u300F +Punct07=\\u301D +Punct08=\\u301E +Punct09=\\u301F +Punct10=\\u309B +Punct11=\\u2018 +Punct12=\\u2019 +Punct13=\\u201A +Punct14=\\u201C +Punct15=\\u201D +Punct16=\\u201E +Punct17=\\u2032 +Punct18=\\u2033 +Punct19=\\u2035 +Punct20=\\u2039 +Punct21=\\u203A +Punct22=\\u201E +Punct23=\\u00BB +Punct24=\\u00AB +Punct25=© +Punct26=’ +Punct27=\\u00A0 +Punct28=\\u2014 + + + Added: incubator/ambari/site/1.2.3/installing-hadoop-using-ambari/content/search/stemmers/de_stemmer.js URL: http://svn.apache.org/viewvc/incubator/ambari/site/1.2.3/installing-hadoop-using-ambari/content/search/stemmers/de_stemmer.js?rev=1487690&view=auto ============================================================================== --- incubator/ambari/site/1.2.3/installing-hadoop-using-ambari/content/search/stemmers/de_stemmer.js (added) +++ incubator/ambari/site/1.2.3/installing-hadoop-using-ambari/content/search/stemmers/de_stemmer.js Thu May 30 00:34:39 2013 @@ -0,0 +1,247 @@ +/* + * Author: Joder Illi + * + * Copyright (c) 2010, FormBlitz AG + * All rights reserved. + * Implementation of the stemming algorithm from http://snowball.tartarus.org/algorithms/german/stemmer.html + * Copyright of the algorithm is: Copyright (c) 2001, Dr Martin Porter and can be found at http://snowball.tartarus.org/license.php + * + * Redistribution and use in source and binary forms, with or without modification, is covered by the standard BSD license. + * + */ + +//var stemmer = function Stemmer() { + /* + German includes the following accented forms, + ä ö ü + and a special letter, ß, equivalent to double s. + The following letters are vowels: + a e i o u y ä ö ü + */ + + var stemmer = function(word) { + /* + Put u and y between vowels into upper case + */ + word = word.replace(/([aeiouyäöü])u([aeiouyäöü])/g, '$1U$2'); + word = word.replace(/([aeiouyäöü])y([aeiouyäöü])/g, '$1Y$2'); + + /* + and then do the following mappings, + (a) replace ß with ss, + (a) replace ae with ä, Not doing these, have trouble with diphtongs + (a) replace oe with ö, Not doing these, have trouble with diphtongs + (a) replace ue with ü unless preceded by q. Not doing these, have trouble with diphtongs + So in quelle, ue is not mapped to ü because it follows q, and in feuer it is not mapped because the first part of the rule changes it to feUer, so the u is not found. + */ + word = word.replace(/ß/g, 'ss'); + //word = word.replace(/ae/g, 'ä'); + //word = word.replace(/oe/g, 'ö'); + //word = word.replace(/([^q])ue/g, '$1ü'); + + /* + R1 and R2 are first set up in the standard way (see the note on R1 and R2), but then R1 is adjusted so that the region before it contains at least 3 letters. + R1 is the region after the first non-vowel following a vowel, or is the null region at the end of the word if there is no such non-vowel. + R2 is the region after the first non-vowel following a vowel in R1, or is the null region at the end of the word if there is no such non-vowel. + */ + + var r1Index = word.search(/[aeiouyäöü][^aeiouyäöü]/); + var r1 = ''; + if (r1Index != -1) { + r1Index += 2; + r1 = word.substring(r1Index); + } + + var r2Index = -1; + var r2 = ''; + + if (r1Index != -1) { + var r2Index = r1.search(/[aeiouyäöü][^aeiouyäöü]/); + if (r2Index != -1) { + r2Index += 2; + r2 = r1.substring(r2Index); + r2Index += r1Index; + } else { + r2 = ''; + } + } + + if (r1Index != -1 && r1Index < 3) { + r1Index = 3; + r1 = word.substring(r1Index); + } + + /* + Define a valid s-ending as one of b, d, f, g, h, k, l, m, n, r or t. + Define a valid st-ending as the same list, excluding letter r. + */ + + /* + Do each of steps 1, 2 and 3. + */ + + /* + Step 1: + Search for the longest among the following suffixes, + (a) em ern er + (b) e en es + (c) s (preceded by a valid s-ending) + */ + var a1Index = word.search(/(em|ern|er)$/g); + var b1Index = word.search(/(e|en|es)$/g); + var c1Index = word.search(/([bdfghklmnrt]s)$/g); + if (c1Index != -1) { + c1Index++; + } + var index1 = 10000; + var optionUsed1 = ''; + if (a1Index != -1 && a1Index < index1) { + optionUsed1 = 'a'; + index1 = a1Index; + } + if (b1Index != -1 && b1Index < index1) { + optionUsed1 = 'b'; + index1 = b1Index; + } + if (c1Index != -1 && c1Index < index1) { + optionUsed1 = 'c'; + index1 = c1Index; + } + + /* + and delete if in R1. (Of course the letter of the valid s-ending is not necessarily in R1.) If an ending of group (b) is deleted, and the ending is preceded by niss, delete the final s. + (For example, äckern -> äck, ackers -> acker, armes -> arm, bedürfnissen -> bedürfnis) + */ + + if (index1 != 10000 && r1Index != -1) { + if (index1 >= r1Index) { + word = word.substring(0, index1); + if (optionUsed1 == 'b') { + if (word.search(/niss$/) != -1) { + word = word.substring(0, word.length -1); + } + } + } + } + /* + Step 2: + Search for the longest among the following suffixes, + (a) en er est + (b) st (preceded by a valid st-ending, itself preceded by at least 3 letters) + */ + + var a2Index = word.search(/(en|er|est)$/g); + var b2Index = word.search(/(.{3}[bdfghklmnt]st)$/g); + if (b2Index != -1) { + b2Index += 4; + } + + var index2 = 10000; + var optionUsed2 = ''; + if (a2Index != -1 && a2Index < index2) { + optionUsed2 = 'a'; + index2 = a2Index; + } + if (b2Index != -1 && b2Index < index2) { + optionUsed2 = 'b'; + index2 = b2Index; + } + + /* + and delete if in R1. + (For example, derbsten -> derbst by step 1, and derbst -> derb by step 2, since b is a valid st-ending, and is preceded by just 3 letters) + */ + + if (index2 != 10000 && r1Index != -1) { + if (index2 >= r1Index) { + word = word.substring(0, index2); + } + } + + /* + Step 3: d-suffixes (*) + Search for the longest among the following suffixes, and perform the action indicated. + end ung + delete if in R2 + if preceded by ig, delete if in R2 and not preceded by e + ig ik isch + delete if in R2 and not preceded by e + lich heit + delete if in R2 + if preceded by er or en, delete if in R1 + keit + delete if in R2 + if preceded by lich or ig, delete if in R2 + */ + + var a3Index = word.search(/(end|ung)$/g); + var b3Index = word.search(/[^e](ig|ik|isch)$/g); + var c3Index = word.search(/(lich|heit)$/g); + var d3Index = word.search(/(keit)$/g); + if (b3Index != -1) { + b3Index ++; + } + + var index3 = 10000; + var optionUsed3 = ''; + if (a3Index != -1 && a3Index < index3) { + optionUsed3 = 'a'; + index3 = a3Index; + } + if (b3Index != -1 && b3Index < index3) { + optionUsed3 = 'b'; + index3 = b3Index; + } + if (c3Index != -1 && c3Index < index3) { + optionUsed3 = 'c'; + index3 = c3Index; + } + if (d3Index != -1 && d3Index < index3) { + optionUsed3 = 'd'; + index3 = d3Index; + } + + if (index3 != 10000 && r2Index != -1) { + if (index3 >= r2Index) { + word = word.substring(0, index3); + var optionIndex = -1; + var optionSubsrt = ''; + if (optionUsed3 == 'a') { + optionIndex = word.search(/[^e](ig)$/); + if (optionIndex != -1) { + optionIndex++; + if (optionIndex >= r2Index) { + word = word.substring(0, optionIndex); + } + } + } else if (optionUsed3 == 'c') { + optionIndex = word.search(/(er|en)$/); + if (optionIndex != -1) { + if (optionIndex >= r1Index) { + word = word.substring(0, optionIndex); + } + } + } else if (optionUsed3 == 'd') { + optionIndex = word.search(/(lich|ig)$/); + if (optionIndex != -1) { + if (optionIndex >= r2Index) { + word = word.substring(0, optionIndex); + } + } + } + } + } + + /* + Finally, + turn U and Y back into lower case, and remove the umlaut accent from a, o and u. + */ + word = word.replace(/U/g, 'u'); + word = word.replace(/Y/g, 'y'); + word = word.replace(/ä/g, 'a'); + word = word.replace(/ö/g, 'o'); + word = word.replace(/ü/g, 'u'); + + return word; + }; +//} \ No newline at end of file Added: incubator/ambari/site/1.2.3/installing-hadoop-using-ambari/content/search/stemmers/en_stemmer.js URL: http://svn.apache.org/viewvc/incubator/ambari/site/1.2.3/installing-hadoop-using-ambari/content/search/stemmers/en_stemmer.js?rev=1487690&view=auto ============================================================================== --- incubator/ambari/site/1.2.3/installing-hadoop-using-ambari/content/search/stemmers/en_stemmer.js (added) +++ incubator/ambari/site/1.2.3/installing-hadoop-using-ambari/content/search/stemmers/en_stemmer.js Thu May 30 00:34:39 2013 @@ -0,0 +1,237 @@ +// Porter stemmer in Javascript. Few comments, but it's easy to follow against the rules in the original +// paper, in +// +// Porter, 1980, An algorithm for suffix stripping, Program, Vol. 14, +// no. 3, pp 130-137, +// +// see also http://www.tartarus.org/~martin/PorterStemmer + +// Release 1 +// Derived from (http://tartarus.org/~martin/PorterStemmer/js.txt) - cjm (iizuu) Aug 24, 2009 + + +var stemmer = (function(){ + + var step2list = { + "ational" : "ate", + "tional" : "tion", + "enci" : "ence", + "anci" : "ance", + "izer" : "ize", + "bli" : "ble", + "alli" : "al", + "entli" : "ent", + "eli" : "e", + "ousli" : "ous", + "ization" : "ize", + "ation" : "ate", + "ator" : "ate", + "alism" : "al", + "iveness" : "ive", + "fulness" : "ful", + "ousness" : "ous", + "aliti" : "al", + "iviti" : "ive", + "biliti" : "ble", + "logi" : "log" + }, + + step3list = { + "icate" : "ic", + "ative" : "", + "alize" : "al", + "iciti" : "ic", + "ical" : "ic", + "ful" : "", + "ness" : "" + }, + + c = "[^aeiou]", // consonant + v = "[aeiouy]", // vowel + C = c + "[^aeiouy]*", // consonant sequence + V = v + "[aeiou]*", // vowel sequence + + mgr0 = "^(" + C + ")?" + V + C, // [C]VC... is m>0 + meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$", // [C]VC[V] is m=1 + mgr1 = "^(" + C + ")?" + V + C + V + C, // [C]VCVC... is m>1 + s_v = "^(" + C + ")?" + v; // vowel in stem + + return function (w) { + var stem, + suffix, + firstch, + re, + re2, + re3, + re4, + origword = w; + + if (w.length < 3) { return w; } + + firstch = w.substr(0,1); + if (firstch == "y") { + w = firstch.toUpperCase() + w.substr(1); + } + + // Step 1a + re = /^(.+?)(ss|i)es$/; + re2 = /^(.+?)([^s])s$/; + + if (re.test(w)) { w = w.replace(re,"$1$2"); } + else if (re2.test(w)) { w = w.replace(re2,"$1$2"); } + + // Step 1b + re = /^(.+?)eed$/; + re2 = /^(.+?)(ed|ing)$/; + if (re.test(w)) { + var fp = re.exec(w); + re = new RegExp(mgr0); + if (re.test(fp[1])) { + re = /.$/; + w = w.replace(re,""); + } + } else if (re2.test(w)) { + var fp = re2.exec(w); + stem = fp[1]; + re2 = new RegExp(s_v); + if (re2.test(stem)) { + w = stem; + re2 = /(at|bl|iz)$/; + re3 = new RegExp("([^aeiouylsz])\\1$"); + re4 = new RegExp("^" + C + v + "[^aeiouwxy]$"); + if (re2.test(w)) { w = w + "e"; } + else if (re3.test(w)) { re = /.$/; w = w.replace(re,""); } + else if (re4.test(w)) { w = w + "e"; } + } + } + + // Step 1c + re = new RegExp("^(.+" + c + ")y$"); + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + w = stem + "i"; + } + + // Step 2 + re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + suffix = fp[2]; + re = new RegExp(mgr0); + if (re.test(stem)) { + w = stem + step2list[suffix]; + } + } + + // Step 3 + re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + suffix = fp[2]; + re = new RegExp(mgr0); + if (re.test(stem)) { + w = stem + step3list[suffix]; + } + } + + // Step 4 + re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/; + re2 = /^(.+?)(s|t)(ion)$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = new RegExp(mgr1); + if (re.test(stem)) { + w = stem; + } + } else if (re2.test(w)) { + var fp = re2.exec(w); + stem = fp[1] + fp[2]; + re2 = new RegExp(mgr1); + if (re2.test(stem)) { + w = stem; + } + } + + // Step 5 + re = /^(.+?)e$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = new RegExp(mgr1); + re2 = new RegExp(meq1); + re3 = new RegExp("^" + C + v + "[^aeiouwxy]$"); + if (re.test(stem) || (re2.test(stem) && !(re3.test(stem)))) { + w = stem; + } + } + + re = /ll$/; + re2 = new RegExp(mgr1); + if (re.test(w) && re2.test(w)) { + re = /.$/; + w = w.replace(re,""); + } + + // and turn initial Y back to y + + if (firstch == "y") { + w = firstch.toLowerCase() + w.substr(1); + } + + // See http://snowball.tartarus.org/algorithms/english/stemmer.html + // "Exceptional forms in general" + var specialWords = { + "skis" : "ski", + "skies" : "sky", + "dying" : "die", + "lying" : "lie", + "tying" : "tie", + "idly" : "idl", + "gently" : "gentl", + "ugly" : "ugli", + "early": "earli", + "only": "onli", + "singly": "singl" + }; + + if(specialWords[origword]){ + w = specialWords[origword]; + } + + if( "sky news howe atlas cosmos bias \ + andes inning outing canning herring \ + earring proceed exceed succeed".indexOf(origword) !== -1 ){ + w = origword; + } + + // These are all overstemmed as gener- + // What about commun- words? + re = /.*generate?s?d?(ing)?$/; + if( re.test(origword) ){ + w = w + 'at'; + } + re = /.*general(ly)?$/; + if( re.test(origword) ){ + w = w + 'al'; + } + re = /.*generic(ally)?$/; + if( re.test(origword) ){ + w = w + 'ic'; + } + re = /.*generous(ly)?$/; + if( re.test(origword) ){ + w = w + 'ous'; + } + // These are overstemmed as commun- + re = /.*communit(ies)?y?/; + if( re.test(origword) ){ + w = w + 'iti'; + } + + return w; + } +})(); Added: incubator/ambari/site/1.2.3/installing-hadoop-using-ambari/content/search/stemmers/fr_stemmer.js URL: http://svn.apache.org/viewvc/incubator/ambari/site/1.2.3/installing-hadoop-using-ambari/content/search/stemmers/fr_stemmer.js?rev=1487690&view=auto ============================================================================== --- incubator/ambari/site/1.2.3/installing-hadoop-using-ambari/content/search/stemmers/fr_stemmer.js (added) +++ incubator/ambari/site/1.2.3/installing-hadoop-using-ambari/content/search/stemmers/fr_stemmer.js Thu May 30 00:34:39 2013 @@ -0,0 +1,299 @@ +/* + * Author: Kasun Gajasinghe + * E-Mail: kasunbg AT gmail DOT com + * Date: 09.08.2010 + * + * usage: stemmer(word); + * ex: var stem = stemmer(foobar); + * Implementation of the stemming algorithm from http://snowball.tartarus.org/algorithms/french/stemmer.html + * + * LICENSE: + * + * Copyright (c) 2010, Kasun Gajasinghe. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * + * THIS SOFTWARE IS PROVIDED BY KASUN GAJASINGHE ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL KASUN GAJASINGHE BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE + * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +var stemmer = function(word){ +// Letters in French include the following accented forms, +// â à ç ë é ê è ï î ô û ù +// The following letters are vowels: +// a e i o u y â à ë é ê è ï î ô û ù + + word = word.toLowerCase(); + var oriWord = word; + word = word.replace(/qu/g, 'qU'); //have to perform first, as after the operation, capital U is not treated as a vowel + word = word.replace(/([aeiouyâàëéêèïîôûù])u([aeiouyâàëéêèïîôûù])/g, '$1U$2'); + word = word.replace(/([aeiouyâàëéêèïîôûù])i([aeiouyâàëéêèïîôûù])/g, '$1I$2'); + word = word.replace(/([aeiouyâàëéêèïîôûù])y/g, '$1Y'); + word = word.replace(/y([aeiouyâàëéêèïîôûù])/g, 'Y$1'); + + var rv=''; + var rvIndex = -1; + if(word.search(/^(par|col|tap)/) != -1 || word.search(/^[aeiouyâàëéêèïîôûù]{2}/) != -1){ + rv = word.substring(3); + rvIndex = 3; + } else { + rvIndex = word.substring(1).search(/[aeiouyâàëéêèïîôûù]/); + if(rvIndex != -1){ + rvIndex +=2; //+2 is to supplement the substring(1) used to find rvIndex + rv = word.substring(rvIndex); + } else { + rvIndex = word.length; + } + } + +// R1 is the region after the first non-vowel following a vowel, or the end of the word if there is no such non-vowel. +// R2 is the region after the first non-vowel following a vowel in R1, or the end of the word if there is no such non-vowel + var r1Index = word.search(/[aeiouyâàëéêèïîôûù][^aeiouyâàëéêèïîôûù]/); + var r1 = ''; + if (r1Index != -1) { + r1Index += 2; + r1 = word.substring(r1Index); + } else { + r1Index = word.length; + } + + var r2Index = -1; + var r2 = ''; + if (r1Index != -1) { + r2Index = r1.search(/[aeiouyâàëéêèïîôûù][^aeiouyâàëéêèïîôûù]/); + if (r2Index != -1) { + r2Index += 2; + r2 = r1.substring(r2Index); + r2Index += r1Index; + } else { + r2 = ''; + r2Index = word.length; + } + } + if (r1Index != -1 && r1Index < 3) { + r1Index = 3; + r1 = word.substring(r1Index); + } + + /* + Step 1: Standard suffix removal + */ + var a1Index = word.search(/(ance|iqUe|isme|able|iste|eux|ances|iqUes|ismes|ables|istes)$/); + var a2Index = word.search(/(atrice|ateur|ation|atrices|ateurs|ations)$/); + var a3Index = word.search(/(logie|logies)$/); + var a4Index = word.search(/(usion|ution|usions|utions)$/); + var a5Index = word.search(/(ence|ences)$/); + var a6Index = word.search(/(ement|ements)$/); + var a7Index = word.search(/(ité|ités)$/); + var a8Index = word.search(/(if|ive|ifs|ives)$/); + var a9Index = word.search(/(eaux)$/); + var a10Index = word.search(/(aux)$/); + var a11Index = word.search(/(euse|euses)$/); + var a12Index = word.search(/[^aeiouyâàëéêèïîôûù](issement|issements)$/); + var a13Index = word.search(/(amment)$/); + var a14Index = word.search(/(emment)$/); + var a15Index = word.search(/[aeiouyâàëéêèïîôûù](ment|ments)$/); + + if(a1Index != -1 && a1Index >= r2Index){ + word = word.substring(0,a1Index); + } else if(a2Index != -1 && a2Index >= r2Index){ + word = word.substring(0,a2Index); + var a2Index2 = word.search(/(ic)$/); + if(a2Index2 != -1 && a2Index2 >= r2Index){ + word = word.substring(0, a2Index2); //if preceded by ic, delete if in R2, + } else { //else replace by iqU + word = word.replace(/(ic)$/,'iqU'); + } + } else if(a3Index != -1 && a3Index >= r2Index){ + word = word.replace(/(logie|logies)$/,'log'); //replace with log if in R2 + } else if(a4Index != -1 && a4Index >= r2Index){ + word = word.replace(/(usion|ution|usions|utions)$/,'u'); //replace with u if in R2 + } else if(a5Index != -1 && a5Index >= r2Index){ + word = word.replace(/(ence|ences)$/,'ent'); //replace with ent if in R2 + } else if(a6Index != -1 && a6Index >= rvIndex){ + word = word.substring(0,a6Index); + if(word.search(/(iv)$/) >= r2Index){ + word = word.replace(/(iv)$/, ''); + if(word.search(/(at)$/) >= r2Index){ + word = word.replace(/(at)$/, ''); + } + } else if(word.search(/(eus)$/) != -1){ + var a6Index2 = word.search(/(eus)$/); + if(a6Index2 >=r2Index){ + word = word.substring(0, a6Index2); + } else if(a6Index2 >= r1Index){ + word = word.substring(0,a6Index2)+"eux"; + } + } else if(word.search(/(abl|iqU)$/) >= r2Index){ + word = word.replace(/(abl|iqU)$/,''); //if preceded by abl or iqU, delete if in R2, + } else if(word.search(/(ièr|Ièr)$/) >= rvIndex){ + word = word.replace(/(ièr|Ièr)$/,'i'); //if preceded by abl or iqU, delete if in R2, + } + } else if(a7Index != -1 && a7Index >= r2Index){ + word = word.substring(0,a7Index); //delete if in R2 + if(word.search(/(abil)$/) != -1){ //if preceded by abil, delete if in R2, else replace by abl, otherwise, + var a7Index2 = word.search(/(abil)$/); + if(a7Index2 >=r2Index){ + word = word.substring(0, a7Index2); + } else { + word = word.substring(0,a7Index2)+"abl"; + } + } else if(word.search(/(ic)$/) != -1){ + var a7Index3 = word.search(/(ic)$/); + if(a7Index3 != -1 && a7Index3 >= r2Index){ + word = word.substring(0, a7Index3); //if preceded by ic, delete if in R2, + } else { //else replace by iqU + word = word.replace(/(ic)$/,'iqU'); + } + } else if(word.search(/(iv)$/) != r2Index){ + word = word.replace(/(iv)$/,''); + } + } else if(a8Index != -1 && a8Index >= r2Index){ + word = word.substring(0,a8Index); + if(word.search(/(at)$/) >= r2Index){ + word = word.replace(/(at)$/, ''); + if(word.search(/(ic)$/) >= r2Index){ + word = word.replace(/(ic)$/, ''); + } else { word = word.replace(/(ic)$/, 'iqU'); } + } + } else if(a9Index != -1){ word = word.replace(/(eaux)/,'eau') + } else if(a10Index >= r1Index){ word = word.replace(/(aux)/,'al') + } else if(a11Index != -1 ){ + var a11Index2 = word.search(/(euse|euses)$/); + if(a11Index2 >=r2Index){ + word = word.substring(0, a11Index2); + } else if(a11Index2 >= r1Index){ + word = word.substring(0, a11Index2)+"eux"; + } + } else if(a12Index!=-1 && a12Index>=r1Index){ + word = word.substring(0,a12Index+1); //+1- amendment to non-vowel + } else if(a13Index!=-1 && a13Index>=rvIndex){ + word = word.replace(/(amment)$/,'ant'); + } else if(a14Index!=-1 && a14Index>=rvIndex){ + word = word.replace(/(emment)$/,'ent'); + } else if(a15Index!=-1 && a15Index>=rvIndex){ + word = word.substring(0,a15Index+1); + } + + /* Step 2a: Verb suffixes beginning i*/ + var wordStep1 = word; + var step2aDone = false; + if(oriWord == word.toLowerCase() || oriWord.search(/(amment|emment|ment|ments)$/) != -1){ + step2aDone = true; + var b1Regex = /([^aeiouyâàëéêèïîôûù])(îmes|ît|îtes|i|ie|ies|ir|ira|irai|iraIent|irais|irait|iras|irent|irez|iriez|irions|irons|iront|is|issaIent|issais|issait|issant|issante|issantes|issants|isse|issent|isses|issez|issiez|issions|issons|it)$/i; + if(word.search(b1Regex) >= rvIndex){ + word = word.replace(b1Regex,'$1'); + } + } + + /* Step 2b: Other verb suffixes*/ + if (step2aDone && wordStep1 == word) { + if (word.search(/(ions)$/) >= r2Index) { + word = word.replace(/(ions)$/, ''); + } else { + var b2Regex = /(é|ée|ées|és|èrent|er|era|erai|eraIent|erais|erait|eras|erez|eriez|erions|erons|eront|ez|iez)$/i; + if (word.search(b2Regex) >= rvIndex) { + word = word.replace(b2Regex, ''); + } else { + var b3Regex = /e(âmes|ât|âtes|a|ai|aIent|ais|ait|ant|ante|antes|ants|as|asse|assent|asses|assiez|assions)$/i; + if (word.search(b3Regex) >= rvIndex) { + word = word.replace(b3Regex, ''); + } else { + var b3Regex2 = /(âmes|ât|âtes|a|ai|aIent|ais|ait|ant|ante|antes|ants|as|asse|assent|asses|assiez|assions)$/i; + if (word.search(b3Regex2) >= rvIndex) { + word = word.replace(b3Regex2, ''); + } + } + } + } + } + + if(oriWord != word.toLowerCase()){ + /* Step 3 */ + var rep = ''; + if(word.search(/Y$/) != -1) { + word = word.replace(/Y$/, 'i'); + } else if(word.search(/ç$/) != -1){ + word = word.replace(/ç$/, 'c'); + } + } else { + /* Step 4 */ + //If the word ends s, not preceded by a, i, o, u, è or s, delete it. + if (word.search(/([^aiouès])s$/) >= rvIndex) { + word = word.replace(/([^aiouès])s$/, '$1'); + } + var e1Index = word.search(/ion$/); + if (e1Index >= r2Index && word.search(/[st]ion$/) >= rvIndex) { + word = word.substring(0, e1Index); + } else { + var e2Index = word.search(/(ier|ière|Ier|Ière)$/); + if (e2Index != -1 && e2Index >= rvIndex) { + word = word.substring(0, e2Index) + "i"; + } else { + if (word.search(/e$/) >= rvIndex) { + word = word.replace(/e$/, ''); //delete last e + } else if (word.search(/guë$/) >= rvIndex) { + word = word.replace(/guë$/, 'gu'); + } + } + } + } + + /* Step 5: Undouble */ + //word = word.replace(/(en|on|et|el|eil)(n|t|l)$/,'$1'); + word = word.replace(/(en|on)(n)$/,'$1'); + word = word.replace(/(ett)$/,'et'); + word = word.replace(/(el|eil)(l)$/,'$1'); + + /* Step 6: Un-accent */ + word = word.replace(/[éè]([^aeiouyâàëéêèïîôûù]+)$/,'e$1'); + word = word.toLowerCase(); + return word; +}; + +var eqOut = new Array(); +var noteqOut = new Array(); +var eqCount = 0; +/* +To test the stemming, create two arrays named "voc" and "COut" which are for vocabualary and the stemmed output. +Then add the vocabulary strings and output strings. This method will generate the stemmed output for "voc" and will +compare the output with COut. + (I used porter's voc and out files and did a regex to convert them to js objects. regex: /");\nvoc.push("/g . This + will add strings to voc array such that output would look like: voc.push("foobar"); ) drop me an email for any help. + */ +function testFr(){ + var start = new Date().getTime(); //execution time + eqCount = 0; + eqOut = new Array(); + noteqOut = new Array(); + for(var k=0;k