-- Generation Time: Jun 11, 2007
-- Last update: Oct 17, 2007
-- Database: `flib`
--
-- BY JULIO RAFFO (EPFL/CEMI)
--
-- --------------------------------------------------------


DELIMITER $$

DROP FUNCTION IF EXISTS flib.dwabbrev $$
CREATE FUNCTION flib.dwabbrev(dirtystring VARCHAR(500)) RETURNS varchar(500) CHARSET utf8
BEGIN

	DECLARE tempstring varchar(500);

set tempstring=concat(' ', dirtystring,' ');

set tempstring=replace(tempstring,' et ',' & ');
set tempstring=replace(tempstring,' und ',' & ');
set tempstring=replace(tempstring,' aktiebolag ',' ab ');
set tempstring=replace(tempstring,' aktiebolaget ',' ab ');
set tempstring=replace(tempstring,' academy ',' acad ');
set tempstring=replace(tempstring,' agactien gesellschaft ',' acad ');
set tempstring=replace(tempstring,' actiengesellschaft ',' acad ');
set tempstring=replace(tempstring,' aktien gesellschaft ',' acad ');
set tempstring=replace(tempstring,' aktiengesellschaft ',' acad ');
set tempstring=replace(tempstring,' agricolas ',' agri ');
set tempstring=replace(tempstring,' agricoles ',' agri ');
set tempstring=replace(tempstring,' agricoli ',' agri ');
set tempstring=replace(tempstring,' agricolture ',' agri ');
set tempstring=replace(tempstring,' agricultura ',' agri ');
set tempstring=replace(tempstring,' agricultural ',' agri ');
set tempstring=replace(tempstring,' agriculture ',' agri ');
set tempstring=replace(tempstring,' agricola ',' agri ');
set tempstring=replace(tempstring,' agricole ',' agri ');
set tempstring=replace(tempstring,' akademia ',' akad ');
set tempstring=replace(tempstring,' akademiei ',' akad ');
set tempstring=replace(tempstring,' akademii ',' akad ');
set tempstring=replace(tempstring,' akademija ',' akad ');
set tempstring=replace(tempstring,' akademiya ',' akad ');
set tempstring=replace(tempstring,' akademiyakh ',' akad ');
set tempstring=replace(tempstring,' akademiyam ',' akad ');
set tempstring=replace(tempstring,' akademiyami ',' akad ');
set tempstring=replace(tempstring,' akademiyu ',' akad ');
set tempstring=replace(tempstring,' akademi ',' akad ');
set tempstring=replace(tempstring,' akademie ',' akad ');
set tempstring=replace(tempstring,' allgemeiner ',' allg ');
set tempstring=replace(tempstring,' allgemeine ',' allg ');
set tempstring=replace(tempstring,' antrepriza ',' antr ');
set tempstring=replace(tempstring,' apararii ',' apar ');
set tempstring=replace(tempstring,' aparate ',' apar ');
set tempstring=replace(tempstring,' aparatelor ',' apar ');
set tempstring=replace(tempstring,' apparate ',' app ');
set tempstring=replace(tempstring,' apparatebau ',' app ');
set tempstring=replace(tempstring,' apparatus ',' app ');
set tempstring=replace(tempstring,' apparechhi ',' app ');
set tempstring=replace(tempstring,' appareil ',' app ');
set tempstring=replace(tempstring,' appareillages ',' app ');
set tempstring=replace(tempstring,' appareils ',' app ');
set tempstring=replace(tempstring,' appareillage ',' app ');
set tempstring=replace(tempstring,' applications ',' appl ');
set tempstring=replace(tempstring,' applicazione ',' appl ');
set tempstring=replace(tempstring,' applicazioni ',' appl ');
set tempstring=replace(tempstring,' application ',' appl ');
set tempstring=replace(tempstring,' anpartsselskabet ',' aps ');
set tempstring=replace(tempstring,' anpartsselskab ',' aps ');
set tempstring=replace(tempstring,' a/s ',' as ');
set tempstring=replace(tempstring,' aktieselskabet ',' as ');
set tempstring=replace(tempstring,' aktieselskab ',' as ');
set tempstring=replace(tempstring,' associacao ',' assoc ');
set tempstring=replace(tempstring,' associate ',' assoc ');
set tempstring=replace(tempstring,' associated ',' assoc ');
set tempstring=replace(tempstring,' associates ',' assoc ');
set tempstring=replace(tempstring,' association ',' assoc ');
set tempstring=replace(tempstring,' beteiligungsgesellschaft ',' bet-ges ');
set tempstring=replace(tempstring,' beteiligungsgesellschaft mbh ',' bet-gmbh ');
set tempstring=replace(tempstring,' beteiligungs gesellschaft mit ',' bet-gmbh ');
set tempstring=replace(tempstring,' beschrankter haftung ',' bet-gmbh ');
set tempstring=replace(tempstring,' broderna ',' brdr ');
set tempstring=replace(tempstring,' brodrene ',' brdr ');
set tempstring=replace(tempstring,' broederna ',' brdr ');
set tempstring=replace(tempstring,' broedrene ',' brdr ');
set tempstring=replace(tempstring,' brothers ',' bros ');
set tempstring=replace(tempstring,' besloten vennootschap ',' bv ');
set tempstring=replace(tempstring,' besloten vennootschap met ',' bv ');
set tempstring=replace(tempstring,' beperkte aansprakelijkheid ',' bv ');
set tempstring=replace(tempstring,' close corporation ',' cc ');
set tempstring=replace(tempstring,' center ',' cent ');
set tempstring=replace(tempstring,' centraal ',' cent ');
set tempstring=replace(tempstring,' central ',' cent ');
set tempstring=replace(tempstring,' centrala ',' cent ');
set tempstring=replace(tempstring,' centrales ',' cent ');
set tempstring=replace(tempstring,' centraux ',' cent ');
set tempstring=replace(tempstring,' centre ',' cent ');
set tempstring=replace(tempstring,' centro ',' cent ');
set tempstring=replace(tempstring,' centrul ',' cent ');
set tempstring=replace(tempstring,' centrum ',' cent ');
set tempstring=replace(tempstring,' centrale ',' cent ');
set tempstring=replace(tempstring,' cercetare ',' cerc ');
set tempstring=replace(tempstring,' cercetari ',' cerc ');
set tempstring=replace(tempstring,' chemicals ',' chem ');
set tempstring=replace(tempstring,' chemicke ',' chem ');
set tempstring=replace(tempstring,' chemickej ',' chem ');
set tempstring=replace(tempstring,' chemicky ',' chem ');
set tempstring=replace(tempstring,' chemickych ',' chem ');
set tempstring=replace(tempstring,' chemiczne ',' chem ');
set tempstring=replace(tempstring,' chemiczny ',' chem ');
set tempstring=replace(tempstring,' chemie ',' chem ');
set tempstring=replace(tempstring,' chemii ',' chem ');
set tempstring=replace(tempstring,' chemisch ',' chem ');
set tempstring=replace(tempstring,' chemische ',' chem ');
set tempstring=replace(tempstring,' chemiskej ',' chem ');
set tempstring=replace(tempstring,' chemistry ',' chem ');
set tempstring=replace(tempstring,' chemical ',' chem ');
set tempstring=replace(tempstring,' chimic ',' chim ');
set tempstring=replace(tempstring,' chimica ',' chim ');
set tempstring=replace(tempstring,' chimice ',' chim ');
set tempstring=replace(tempstring,' chimici ',' chim ');
set tempstring=replace(tempstring,' chimico ',' chim ');
set tempstring=replace(tempstring,' chimie ',' chim ');
set tempstring=replace(tempstring,' chimiei ',' chim ');
set tempstring=replace(tempstring,' chimieskoj ',' chim ');
set tempstring=replace(tempstring,' chimii ',' chim ');
set tempstring=replace(tempstring,' chimiko ',' chim ');
set tempstring=replace(tempstring,' chimiques ',' chim ');
set tempstring=replace(tempstring,' chimiya ',' chim ');
set tempstring=replace(tempstring,' chimiyakh ',' chim ');
set tempstring=replace(tempstring,' chimiyam ',' chim ');
set tempstring=replace(tempstring,' chimiyami ',' chim ');
set tempstring=replace(tempstring,' chimiyu ',' chim ');
set tempstring=replace(tempstring,' chimique ',' chim ');
set tempstring=replace(tempstring,' compagnia ',' cia  ');
set tempstring=replace(tempstring,' companhia ',' cia  ');
set tempstring=replace(tempstring,' compagnie ',' cie  ');
set tempstring=replace(tempstring,' compagnie francaise ',' cie fr ');
set tempstring=replace(tempstring,' compagnie generale ',' cie gen ');
set tempstring=replace(tempstring,' compagnie industriale ',' cie ind ');
set tempstring=replace(tempstring,' compagnie industrielle ',' cie ind ');
set tempstring=replace(tempstring,' compagnie industrielles ',' cie ind ');
set tempstring=replace(tempstring,' compagnie internationale ',' cie int  ');
set tempstring=replace(tempstring,' compagnie nationale ',' cie nat ');
set tempstring=replace(tempstring,' compagnie parisien ',' cie paris ');
set tempstring=replace(tempstring,' compagnie parisienn ',' cie paris ');
set tempstring=replace(tempstring,' compagnie parisienne ',' cie paris ');
set tempstring=replace(tempstring,' companies ',' co ');
set tempstring=replace(tempstring,' company ',' co ');
set tempstring=replace(tempstring,' combinatul ',' comb ');
set tempstring=replace(tempstring,' commerciale ',' comml ');
set tempstring=replace(tempstring,' commercial ',' comml ');
set tempstring=replace(tempstring,' consolidated ',' consol ');
set tempstring=replace(tempstring,' construccion ',' constr ');
set tempstring=replace(tempstring,' construcciones ',' constr ');
set tempstring=replace(tempstring,' constructie ',' constr ');
set tempstring=replace(tempstring,' constructii ',' constr ');
set tempstring=replace(tempstring,' constructiilor ',' constr ');
set tempstring=replace(tempstring,' constructions ',' constr ');
set tempstring=replace(tempstring,' constructor ',' constr ');
set tempstring=replace(tempstring,' constructortul ',' constr ');
set tempstring=replace(tempstring,' constructorul ',' constr ');
set tempstring=replace(tempstring,' construccione ',' constr ');
set tempstring=replace(tempstring,' construction ',' constr ');
set tempstring=replace(tempstring,' co-operatives ',' coop ');
set tempstring=replace(tempstring,' cooperatieve ',' coop ');
set tempstring=replace(tempstring,' cooperativa ',' coop ');
set tempstring=replace(tempstring,' cooperatives ',' coop ');
set tempstring=replace(tempstring,' co-operative ',' coop ');
set tempstring=replace(tempstring,' cooperative ',' coop ');
set tempstring=replace(tempstring,' corporate ',' corp ');
set tempstring=replace(tempstring,' corporation ',' corp ');
set tempstring=replace(tempstring,' costruzioni ',' costr ');
set tempstring=replace(tempstring,' deutschen ',' ddr  ');
set tempstring=replace(tempstring,' demokratischen republik ',' ddr  ');
set tempstring=replace(tempstring,' deutsche ',' ddr  ');
set tempstring=replace(tempstring,' demokratische ',' ddr  ');
set tempstring=replace(tempstring,' departement ',' dept ');
set tempstring=replace(tempstring,' department ',' dept ');
set tempstring=replace(tempstring,' deutsch ',' deut ');
set tempstring=replace(tempstring,' deutsches ',' deut ');
set tempstring=replace(tempstring,' deutschen ',' deut ');
set tempstring=replace(tempstring,' deutscher ',' deut ');
set tempstring=replace(tempstring,' deutschland ',' deut ');
set tempstring=replace(tempstring,' deutsche ',' deut ');
set tempstring=replace(tempstring,' develop ',' dev  ');
set tempstring=replace(tempstring,' developments ',' dev  ');
set tempstring=replace(tempstring,' developpements ',' dev  ');
set tempstring=replace(tempstring,' development ',' dev  ');
set tempstring=replace(tempstring,' developpement ',' dev  ');
set tempstring=replace(tempstring,' divisione ',' div  ');
set tempstring=replace(tempstring,' division ',' div  ');
set tempstring=replace(tempstring,' engineering ',' eng  ');
set tempstring=replace(tempstring,' equipements ',' equip ');
set tempstring=replace(tempstring,' equipments ',' equip ');
set tempstring=replace(tempstring,' equipement ',' equip ');
set tempstring=replace(tempstring,' equipment ',' equip ');
set tempstring=replace(tempstring,' establishments ',' estab ');
set tempstring=replace(tempstring,' establissements ',' estab ');
set tempstring=replace(tempstring,' establishment ',' estab ');
set tempstring=replace(tempstring,' establissement ',' estab ');
set tempstring=replace(tempstring,' etablissements ',' etab ');
set tempstring=replace(tempstring,' etabs ',' etab ');
set tempstring=replace(tempstring,' ets ',' etab ');
set tempstring=replace(tempstring,' etablissement ',' etab ');
set tempstring=replace(tempstring,' etudes ',' etud ');
set tempstring=replace(tempstring,' etude ',' etud ');
set tempstring=replace(tempstring,' europaeischen ',' euro ');
set tempstring=replace(tempstring,' europaeisches ',' euro ');
set tempstring=replace(tempstring,' europaischen ',' euro ');
set tempstring=replace(tempstring,' europaisches ',' euro ');
set tempstring=replace(tempstring,' europe ',' euro ');
set tempstring=replace(tempstring,' europea ',' euro ');
set tempstring=replace(tempstring,' european ',' euro ');
set tempstring=replace(tempstring,' europeen ',' euro ');
set tempstring=replace(tempstring,' europeenne ',' euro ');
set tempstring=replace(tempstring,' europaeische ',' euro ');
set tempstring=replace(tempstring,' europaische ',' euro ');
set tempstring=replace(tempstring,' eingetragener verein ',' ev ');
set tempstring=replace(tempstring,' exploaterings ',' expl ');
set tempstring=replace(tempstring,' exploitatie ',' expl ');
set tempstring=replace(tempstring,' exploitations ',' expl ');
set tempstring=replace(tempstring,' exploatering ',' expl ');
set tempstring=replace(tempstring,' exploitation ',' expl ');
set tempstring=replace(tempstring,' firma ',' fa ');
set tempstring=replace(tempstring,' fabbricazioni ',' fab ');
set tempstring=replace(tempstring,' fabbriche ',' fab ');
set tempstring=replace(tempstring,' fabrica ',' fab ');
set tempstring=replace(tempstring,' fabrications ',' fab ');
set tempstring=replace(tempstring,' fabrieken ',' fab ');
set tempstring=replace(tempstring,' fabriker ',' fab ');
set tempstring=replace(tempstring,' fabriques ',' fab ');
set tempstring=replace(tempstring,' fabrizio ',' fab ');
set tempstring=replace(tempstring,' fabryka ',' fab ');
set tempstring=replace(tempstring,' fabrication ',' fab ');
set tempstring=replace(tempstring,' fabriek ',' fab ');
set tempstring=replace(tempstring,' fabrik ',' fab ');
set tempstring=replace(tempstring,' fabrique ',' fab ');
set tempstring=replace(tempstring,' fabbrica ',' fab  ');
set tempstring=replace(tempstring,' farmaceutica ',' farm ');
set tempstring=replace(tempstring,' farmaceutice ',' farm ');
set tempstring=replace(tempstring,' farmaceutiche ',' farm ');
set tempstring=replace(tempstring,' farmaceutici ',' farm ');
set tempstring=replace(tempstring,' farmaceuticos ',' farm ');
set tempstring=replace(tempstring,' farmaceutisk ',' farm ');
set tempstring=replace(tempstring,' farmacevtskih ',' farm ');
set tempstring=replace(tempstring,' farmacie ',' farm ');
set tempstring=replace(tempstring,' farmaceutico ',' farm ');
set tempstring=replace(tempstring,' fondation ',' fond ');
set tempstring=replace(tempstring,' fondazione ',' fond ');
set tempstring=replace(tempstring,' foundations ',' found ');
set tempstring=replace(tempstring,' foundation ',' found ');
set tempstring=replace(tempstring,' francaise ',' fr ');
set tempstring=replace(tempstring,' francais ',' fr ');
set tempstring=replace(tempstring,' f lli ',' frat ');
set tempstring=replace(tempstring,' flli ',' frat ');
set tempstring=replace(tempstring,' fratelli ',' frat ');
set tempstring=replace(tempstring,' geb ',' gebr ');
set tempstring=replace(tempstring,' gebroders ',' gebr ');
set tempstring=replace(tempstring,' gebroeders ',' gebr ');
set tempstring=replace(tempstring,' gebruders ',' gebr ');
set tempstring=replace(tempstring,' gebrueders ',' gebr ');
set tempstring=replace(tempstring,' gebroder ',' gebr ');
set tempstring=replace(tempstring,' gebroeder ',' gebr ');
set tempstring=replace(tempstring,' gebruder ',' gebr ');
set tempstring=replace(tempstring,' gebrueder ',' gebr ');
set tempstring=replace(tempstring,' generala ',' gen ');
set tempstring=replace(tempstring,' generales ',' gen ');
set tempstring=replace(tempstring,' generaux ',' gen ');
set tempstring=replace(tempstring,' generale ',' gen ');
set tempstring=replace(tempstring,' general ',' gen  ');
set tempstring=replace(tempstring,' gesellschaft ',' ges  ');
set tempstring=replace(tempstring,' gewerkschaft ',' gew  ');
set tempstring=replace(tempstring,' gakko hojin ',' gh ');
set tempstring=replace(tempstring,' gakko houjin ',' gh ');
set tempstring=replace(tempstring,' gutehoffnungschuette ',' ghh  ');
set tempstring=replace(tempstring,' gutehoffnungschutte ',' ghh  ');
set tempstring=replace(tempstring,' gomei gaisha ',' gk ');
set tempstring=replace(tempstring,' gomei kaisha ',' gk ');
set tempstring=replace(tempstring,' goshi kaisha ',' gk ');
set tempstring=replace(tempstring,' gkgoushi gaisha ',' gk ');
set tempstring=replace(tempstring,' gesellschaft mbh ',' gmbh ');
set tempstring=replace(tempstring,' gesellschaft mit ',' gmbh ');
set tempstring=replace(tempstring,' beschrankter haftung ',' gmbh ');
set tempstring=replace(tempstring,' groupment ',' grp ');
set tempstring=replace(tempstring,' groupement ',' grp  ');
set tempstring=replace(tempstring,' handelsmaatschappij ',' handl ');
set tempstring=replace(tempstring,' handelsmij ',' handl ');
set tempstring=replace(tempstring,' handels bolaget ',' hb ');
set tempstring=replace(tempstring,' handelsbolaget ',' hb ');
set tempstring=replace(tempstring,' incorporation ',' inc ');
set tempstring=replace(tempstring,' incorporated ',' inc  ');
set tempstring=replace(tempstring,' industrias ',' ind ');
set tempstring=replace(tempstring,' industrials ',' ind ');
set tempstring=replace(tempstring,' industriala ',' ind ');
set tempstring=replace(tempstring,' industriale ',' ind ');
set tempstring=replace(tempstring,' industriali ',' ind ');
set tempstring=replace(tempstring,' industrializare ',' ind ');
set tempstring=replace(tempstring,' industrializarea ',' ind ');
set tempstring=replace(tempstring,' industrie ',' ind ');
set tempstring=replace(tempstring,' industrieele ',' ind ');
set tempstring=replace(tempstring,' industriei ',' ind ');
set tempstring=replace(tempstring,' industriels ',' ind ');
set tempstring=replace(tempstring,' industriell ',' ind ');
set tempstring=replace(tempstring,' industrielles ',' ind ');
set tempstring=replace(tempstring,' industrier ',' ind ');
set tempstring=replace(tempstring,' industries ',' ind ');
set tempstring=replace(tempstring,' industrii ',' ind ');
set tempstring=replace(tempstring,' industrij ',' ind ');
set tempstring=replace(tempstring,' industriya ',' ind ');
set tempstring=replace(tempstring,' industriyakh ',' ind ');
set tempstring=replace(tempstring,' industriyam ',' ind ');
set tempstring=replace(tempstring,' industriyami ',' ind ');
set tempstring=replace(tempstring,' industriyu ',' ind ');
set tempstring=replace(tempstring,' industry ',' ind ');
set tempstring=replace(tempstring,' industria ',' ind ');
set tempstring=replace(tempstring,' industrial ',' ind ');
set tempstring=replace(tempstring,' industriel ',' ind ');
set tempstring=replace(tempstring,' industrielle ',' ind ');
set tempstring=replace(tempstring,' industri ',' ind  ');
set tempstring=replace(tempstring,' ingenieria ',' ing ');
set tempstring=replace(tempstring,' ingenieurs ',' ing ');
set tempstring=replace(tempstring,' ingenieurbuero ',' ing ');
set tempstring=replace(tempstring,' ingenieurbureau ',' ing ');
set tempstring=replace(tempstring,' ingenieurburo ',' ing ');
set tempstring=replace(tempstring,' ingenieurgesellschaft ',' ing ');
set tempstring=replace(tempstring,' ingenieursbureau ',' ing ');
set tempstring=replace(tempstring,' ingenieurtechnisches ',' ing ');
set tempstring=replace(tempstring,' ingenioerfirmaet ',' ing ');
set tempstring=replace(tempstring,' ingeniorsfirma ',' ing ');
set tempstring=replace(tempstring,' ingeniorsfirman ',' ing ');
set tempstring=replace(tempstring,' ingenjorsfirma ',' ing ');
set tempstring=replace(tempstring,' inginerie ',' ing ');
set tempstring=replace(tempstring,' ingenieur ',' ing ');
set tempstring=replace(tempstring,' ingenieurtechnische ',' ing ');
set tempstring=replace(tempstring,' ingenier ',' ing  ');
set tempstring=replace(tempstring,' institut ',' inst ');
set tempstring=replace(tempstring,' instituta ',' inst ');
set tempstring=replace(tempstring,' institutam ',' inst ');
set tempstring=replace(tempstring,' institutami ',' inst ');
set tempstring=replace(tempstring,' institutamkh ',' inst ');
set tempstring=replace(tempstring,' institutes ',' inst ');
set tempstring=replace(tempstring,' institutet ',' inst ');
set tempstring=replace(tempstring,' instituto ',' inst ');
set tempstring=replace(tempstring,' inst institutom ',' inst ');
set tempstring=replace(tempstring,' institutov ',' inst ');
set tempstring=replace(tempstring,' institutt ',' inst ');
set tempstring=replace(tempstring,' institutu ',' inst ');
set tempstring=replace(tempstring,' institutul ',' inst ');
set tempstring=replace(tempstring,' instituty ',' inst ');
set tempstring=replace(tempstring,' instituut ',' inst ');
set tempstring=replace(tempstring,' institzht ',' inst ');
set tempstring=replace(tempstring,' instytut ',' inst ');
set tempstring=replace(tempstring,' institute ',' inst ');
set tempstring=replace(tempstring,' institute francaise ',' inst fr ');
set tempstring=replace(tempstring,' institut ',' inst fr ');
set tempstring=replace(tempstring,' institute nationale ',' inst nat  ');
set tempstring=replace(tempstring,' institut ',' inst nat  ');
set tempstring=replace(tempstring,' insinoeoeritomisto ',' instmsto ');
set tempstring=replace(tempstring,' insino ',' instmsto ');
set tempstring=replace(tempstring,' instruments ',' instr ');
set tempstring=replace(tempstring,' instrumentation ',' instr ');
set tempstring=replace(tempstring,' instrumente ',' instr ');
set tempstring=replace(tempstring,' instrument ',' instr ');
set tempstring=replace(tempstring,' international ',' int ');
set tempstring=replace(tempstring,' internationalen ',' int ');
set tempstring=replace(tempstring,' internationaux ',' int ');
set tempstring=replace(tempstring,' internationella ',' int ');
set tempstring=replace(tempstring,' internazionale ',' int ');
set tempstring=replace(tempstring,' internationale ',' int ');
set tempstring=replace(tempstring,' internacional ',' int  ');
set tempstring=replace(tempstring,' intreprinderea ',' intr ');
set tempstring=replace(tempstring,' istituto ',' ist  ');
set tempstring=replace(tempstring,' itali ',' ital ');
set tempstring=replace(tempstring,' italia ',' ital ');
set tempstring=replace(tempstring,' italian ',' ital ');
set tempstring=replace(tempstring,' italiana ',' ital ');
set tempstring=replace(tempstring,' italiane ',' ital ');
set tempstring=replace(tempstring,' italiani ',' ital ');
set tempstring=replace(tempstring,' italiano ',' ital ');
set tempstring=replace(tempstring,' italien ',' ital ');
set tempstring=replace(tempstring,' italienne ',' ital ');
set tempstring=replace(tempstring,' italo ',' ital ');
set tempstring=replace(tempstring,' italy ',' ital ');
set tempstring=replace(tempstring,' kommandit bolag ',' kb ');
set tempstring=replace(tempstring,' kommandit bolaget ',' kb ');
set tempstring=replace(tempstring,' kommanditbolag ',' kb ');
set tempstring=replace(tempstring,' kommanditbolaget ',' kb ');
set tempstring=replace(tempstring,' kommandit gesellschaft ',' kg ');
set tempstring=replace(tempstring,' kommanditgesellschaft ',' kg ');
set tempstring=replace(tempstring,' kommandit gesellschaft auf aktien ',' kgaa ');
set tempstring=replace(tempstring,' kommanditgesellschaft auf aktien ',' kgaa ');
set tempstring=replace(tempstring,' kutato intezet ',' ki ');
set tempstring=replace(tempstring,' kutato intezete ',' ki ');
set tempstring=replace(tempstring,' kutatointezet ',' ki ');
set tempstring=replace(tempstring,' kutatointezete ',' ki ');
set tempstring=replace(tempstring,' kabushiki gaisha ',' kk ');
set tempstring=replace(tempstring,' kabushiki kaisha ',' kk ');
set tempstring=replace(tempstring,' kabushiki kaisya ',' kk ');
set tempstring=replace(tempstring,' kabushikikaisha ',' kk ');
set tempstring=replace(tempstring,' kabushikikaisya ',' kk ');
set tempstring=replace(tempstring,' kombinat ',' komb ');
set tempstring=replace(tempstring,' kombinatu ',' komb ');
set tempstring=replace(tempstring,' kombinaty ',' komb ');
set tempstring=replace(tempstring,' koninklijke ',' konink ');
set tempstring=replace(tempstring,' koncernovy podnik ',' kp ');
set tempstring=replace(tempstring,' kunststoff ',' kunst ');
set tempstring=replace(tempstring,' kunststofftechnik ',' kunst ');
set tempstring=replace(tempstring,' laboratoires ',' lab ');
set tempstring=replace(tempstring,' laboratori ',' lab ');
set tempstring=replace(tempstring,' laboratoriei ',' lab ');
set tempstring=replace(tempstring,' laboratories ',' lab ');
set tempstring=replace(tempstring,' laboratorii ',' lab ');
set tempstring=replace(tempstring,' laboratorij ',' lab ');
set tempstring=replace(tempstring,' laboratorios ',' lab ');
set tempstring=replace(tempstring,' laboratorium ',' lab ');
set tempstring=replace(tempstring,' laboratory ',' lab ');
set tempstring=replace(tempstring,' labortori ',' lab ');
set tempstring=replace(tempstring,' laboratoire ',' lab ');
set tempstring=replace(tempstring,' laboratorio ',' lab ');
set tempstring=replace(tempstring,' laboratoir ',' lab  ');
set tempstring=replace(tempstring,' lavoraza ',' lavoraz ');
set tempstring=replace(tempstring,' lavorazi ',' lavoraz ');
set tempstring=replace(tempstring,' lavorazio ',' lavoraz ');
set tempstring=replace(tempstring,' lavorazione ',' lavoraz ');
set tempstring=replace(tempstring,' lavorazioni ',' lavoraz ');
set tempstring=replace(tempstring,' limited partnership ',' lp ');
set tempstring=replace(tempstring,' limited ',' ltd  ');
set tempstring=replace(tempstring,' limitada ',' ltda ');
set tempstring=replace(tempstring,' maschin ',' masch ');
set tempstring=replace(tempstring,' maschinen ',' masch ');
set tempstring=replace(tempstring,' maschinenvertrieb ',' masch ');
set tempstring=replace(tempstring,' maschinenbau ',' maschbau ');
set tempstring=replace(tempstring,' maschinenbauanstalt ',' maschbau ');
set tempstring=replace(tempstring,' maschinenfab ',' maschfab ');
set tempstring=replace(tempstring,' maschinenfabriek ',' maschfab ');
set tempstring=replace(tempstring,' maschinenfabriken ',' maschfab ');
set tempstring=replace(tempstring,' maschinenfabrik ',' maschfab ');
set tempstring=replace(tempstring,' mit beschrankter haftung ',' mbh  ');
set tempstring=replace(tempstring,' manufacturings ',' mfg  ');
set tempstring=replace(tempstring,' manufacturing ',' mfg  ');
set tempstring=replace(tempstring,' manifatturas ',' mfr  ');
set tempstring=replace(tempstring,' manifatture ',' mfr  ');
set tempstring=replace(tempstring,' manufacturas ',' mfr  ');
set tempstring=replace(tempstring,' manufacture ',' mfr  ');
set tempstring=replace(tempstring,' manufacturers ',' mfr  ');
set tempstring=replace(tempstring,' manufactures ',' mfr  ');
set tempstring=replace(tempstring,' manufatura ',' mfr  ');
set tempstring=replace(tempstring,' manifattura ',' mfr  ');
set tempstring=replace(tempstring,' manufacturer ',' mfr  ');
set tempstring=replace(tempstring,' maatschappij ',' mij ');
set tempstring=replace(tempstring,' ministere ',' min ');
set tempstring=replace(tempstring,' ministerium ',' min ');
set tempstring=replace(tempstring,' ministero ',' min ');
set tempstring=replace(tempstring,' ministerstv ',' min ');
set tempstring=replace(tempstring,' ministerstva ',' min ');
set tempstring=replace(tempstring,' ministerstvakh ',' min ');
set tempstring=replace(tempstring,' ministerstvam ',' min ');
set tempstring=replace(tempstring,' ministerstvami ',' min ');
set tempstring=replace(tempstring,' ministerstve ',' min ');
set tempstring=replace(tempstring,' ministerstvo ',' min ');
set tempstring=replace(tempstring,' ministerstvom ',' min ');
set tempstring=replace(tempstring,' ministerstvu ',' min ');
set tempstring=replace(tempstring,' ministerstwo ',' min ');
set tempstring=replace(tempstring,' ministerul ',' min ');
set tempstring=replace(tempstring,' ministre ',' min ');
set tempstring=replace(tempstring,' ministry ',' min ');
set tempstring=replace(tempstring,' minister ',' min  ');
set tempstring=replace(tempstring,' magyar tudomanyos akademia ',' mta  ');
set tempstring=replace(tempstring,' nationale ',' nat ');
set tempstring=replace(tempstring,' nationaux ',' nat ');
set tempstring=replace(tempstring,' nationaal ',' nat  ');
set tempstring=replace(tempstring,' national ',' nat  ');
set tempstring=replace(tempstring,' nazionale ',' naz  ');
set tempstring=replace(tempstring,' nazionali ',' naz  ');
set tempstring=replace(tempstring,' norddeutsch ',' norddeut ');
set tempstring=replace(tempstring,' norddeutsche ',' norddeut ');
set tempstring=replace(tempstring,' norddeutscher ',' norddeut ');
set tempstring=replace(tempstring,' norddeutsches ',' norddeut ');
set tempstring=replace(tempstring,' narodni podnik ',' np ');
set tempstring=replace(tempstring,' narodnij podnik ',' np ');
set tempstring=replace(tempstring,' narodny podnik ',' np ');
set tempstring=replace(tempstring,' naamloose venootschap ',' nv ');
set tempstring=replace(tempstring,' naamloze vennootschap ',' nv ');
set tempstring=replace(tempstring,' oesterreich ',' oesterr ');
set tempstring=replace(tempstring,' oesterreichisch ',' oesterr ');
set tempstring=replace(tempstring,' oesterreichisches ',' oesterr ');
set tempstring=replace(tempstring,' osterreich ',' oesterr ');
set tempstring=replace(tempstring,' oesterreichische ',' oesterr ');
set tempstring=replace(tempstring,' officine meccanica ',' off mec ');
set tempstring=replace(tempstring,' officine meccaniche ',' off mec ');
set tempstring=replace(tempstring,' officine nationale ',' off nat  ');
set tempstring=replace(tempstring,' offene handelsgesellschaft ',' ohg  ');
set tempstring=replace(tempstring,' ontwikkelings ',' ontwik ');
set tempstring=replace(tempstring,' ontwikkelingsbureau ',' ontwik ');
set tempstring=replace(tempstring,' oborovy podnik ',' op ');
set tempstring=replace(tempstring,' organisatie ',' org ');
set tempstring=replace(tempstring,' organisations ',' org ');
set tempstring=replace(tempstring,' organizations ',' org ');
set tempstring=replace(tempstring,' organizzazione ',' org ');
set tempstring=replace(tempstring,' oyosakeyhtio ',' org ');
set tempstring=replace(tempstring,' organisation ',' org ');
set tempstring=replace(tempstring,' organization ',' org ');
set tempstring=replace(tempstring,' osterreichisch ',' oste ');
set tempstring=replace(tempstring,' osterreichisches ',' oste ');
set tempstring=replace(tempstring,' osterreichische ',' oste ');
set tempstring=replace(tempstring,' pharmaceutica ',' pharm ');
set tempstring=replace(tempstring,' pharmaceuticals ',' pharm ');
set tempstring=replace(tempstring,' pharmaceutiques ',' pharm ');
set tempstring=replace(tempstring,' pharmazeutika ',' pharm ');
set tempstring=replace(tempstring,' pharmazeutisch ',' pharm ');
set tempstring=replace(tempstring,' pharmazeutischen ',' pharm ');
set tempstring=replace(tempstring,' pharmazie ',' pharm ');
set tempstring=replace(tempstring,' pharmaceutical ',' pharm ');
set tempstring=replace(tempstring,' pharmaceutique ',' pharm ');
set tempstring=replace(tempstring,' pharmazeutische ',' pharm ');
set tempstring=replace(tempstring,' public limited company ',' plc  ');
set tempstring=replace(tempstring,' prelucrare ',' prel ');
set tempstring=replace(tempstring,' prelucrarea ',' preluc ');
set tempstring=replace(tempstring,' prodotti ',' prod ');
set tempstring=replace(tempstring,' produce ',' prod ');
set tempstring=replace(tempstring,' products ',' prod ');
set tempstring=replace(tempstring,' productas ',' prod ');
set tempstring=replace(tempstring,' productie ',' prod ');
set tempstring=replace(tempstring,' productos ',' prod ');
set tempstring=replace(tempstring,' productores ',' prod ');
set tempstring=replace(tempstring,' produits ',' prod ');
set tempstring=replace(tempstring,' produkcji ',' prod ');
set tempstring=replace(tempstring,' produkt ',' prod ');
set tempstring=replace(tempstring,' produkte ',' prod ');
set tempstring=replace(tempstring,' produkter ',' prod ');
set tempstring=replace(tempstring,' produse ',' prod ');
set tempstring=replace(tempstring,' produtos ',' prod ');
set tempstring=replace(tempstring,' product ',' prod ');
set tempstring=replace(tempstring,' producta ',' prod ');
set tempstring=replace(tempstring,' producto ',' prod ');
set tempstring=replace(tempstring,' produit ',' prod ');
set tempstring=replace(tempstring,' produits chimiques ',' prod chim ');
set tempstring=replace(tempstring,' produit ',' prod chim ');
set tempstring=replace(tempstring,' productions ',' prodn ');
set tempstring=replace(tempstring,' produktions ',' prodn ');
set tempstring=replace(tempstring,' produzioni ',' prodn ');
set tempstring=replace(tempstring,' production ',' prodn ');
set tempstring=replace(tempstring,' produktion ',' prodn ');
set tempstring=replace(tempstring,' proiectare ',' proi ');
set tempstring=replace(tempstring,' proiectari ',' proi ');
set tempstring=replace(tempstring,' przedsiebiostwo ',' przedsieb ');
set tempstring=replace(tempstring,' przemyslu ',' przeym ');
set tempstring=replace(tempstring,' proprietary ',' pty  ');
set tempstring=replace(tempstring,' personenvennootschap met beperkte aansprakelijkheid ',' pvba ');
set tempstring=replace(tempstring,' realisations ',' real ');
set tempstring=replace(tempstring,' realisation ',' real ');
set tempstring=replace(tempstring,' recherches ',' rech ');
set tempstring=replace(tempstring,' recherche ',' rech ');
set tempstring=replace(tempstring,' recherches et developments ',' rech & dev  ');
set tempstring=replace(tempstring,' recherches et developpements ',' rech & dev  ');
set tempstring=replace(tempstring,' recherche ',' rech & dev  ');
set tempstring=replace(tempstring,' recherche ',' rech & dev  ');
set tempstring=replace(tempstring,' research ',' res  ');
set tempstring=replace(tempstring,' research & development ',' res & dev ');
set tempstring=replace(tempstring,' research and development ',' res & dev ');
set tempstring=replace(tempstring,' rijksuniversiteit ',' rijksuniv ');
set tempstring=replace(tempstring,' sa dite ',' sa ');
set tempstring=replace(tempstring,' sociedad anonima ',' sa ');
set tempstring=replace(tempstring,' societe anonyme ',' sa ');
set tempstring=replace(tempstring,' societe anonyme dite ',' sa ');
set tempstring=replace(tempstring,' societe a responsabilite limitee ',' sarl ');
set tempstring=replace(tempstring,' societe a responsibilite limitee ',' sarl ');
set tempstring=replace(tempstring,' societa in accomandita semplice ',' sas  ');
set tempstring=replace(tempstring,' schweizer ',' schweiz ');
set tempstring=replace(tempstring,' schweizerisch ',' schweiz ');
set tempstring=replace(tempstring,' schweizerisches ',' schweiz ');
set tempstring=replace(tempstring,' schweizerischer ',' schweiz ');
set tempstring=replace(tempstring,' schweizerische ',' schweiz ');
set tempstring=replace(tempstring,' sciences ',' sci ');
set tempstring=replace(tempstring,' scientific ',' sci ');
set tempstring=replace(tempstring,' scientifica ',' sci ');
set tempstring=replace(tempstring,' scientifiques ',' sci ');
set tempstring=replace(tempstring,' science ',' sci ');
set tempstring=replace(tempstring,' scientifique ',' sci ');
set tempstring=replace(tempstring,' secretary ',' sec  ');
set tempstring=replace(tempstring,' shadan houjin ',' sh ');
set tempstring=replace(tempstring,' shadan ho ',' sh ');
set tempstring=replace(tempstring,' siderurgic ',' sider ');
set tempstring=replace(tempstring,' siderurgicas ',' sider ');
set tempstring=replace(tempstring,' siderurgie ',' sider ');
set tempstring=replace(tempstring,' siderurgique ',' sider ');
set tempstring=replace(tempstring,' siderurgica ',' sider ');
set tempstring=replace(tempstring,' societa in nome collectivo ',' snc ');
set tempstring=replace(tempstring,' societe en nom collectif ',' snc ');
set tempstring=replace(tempstring,' sociedad ',' soc ');
set tempstring=replace(tempstring,' sociedade ',' soc ');
set tempstring=replace(tempstring,' societa ',' soc ');
set tempstring=replace(tempstring,' societe ',' soc ');
set tempstring=replace(tempstring,' society ',' soc ');
set tempstring=replace(tempstring,' societe alsacienne ',' soc alsac  ');
set tempstring=replace(tempstring,' societe application ',' soc appl  ');
set tempstring=replace(tempstring,' societa applicazione ',' soc appl  ');
set tempstring=replace(tempstring,' societe auxiliaire ',' soc aux ');
set tempstring=replace(tempstring,' societe chimique ',' soc chim  ');
set tempstring=replace(tempstring,' sociedad civil ',' soc civ  ');
set tempstring=replace(tempstring,' societe civile ',' soc civ  ');
set tempstring=replace(tempstring,' societe commerciales ',' soc comml  ');
set tempstring=replace(tempstring,' societe commerciale ',' soc comml  ');
set tempstring=replace(tempstring,' sociedad espanola ',' soc espan  ');
set tempstring=replace(tempstring,' societe etudes ',' soc etud   ');
set tempstring=replace(tempstring,' societe etude ',' soc etud   ');
set tempstring=replace(tempstring,' societe exploitation ',' soc expl  ');
set tempstring=replace(tempstring,' societe generale ',' soc gen  ');
set tempstring=replace(tempstring,' societe industrielles ',' soc ind ');
set tempstring=replace(tempstring,' societe industrielle ',' soc ind ');
set tempstring=replace(tempstring,' societe mecaniques ',' soc mec  ');
set tempstring=replace(tempstring,' societe mecanique ',' soc mec  ');
set tempstring=replace(tempstring,' societe nationale ',' soc nat  ');
set tempstring=replace(tempstring,' societe nouvelle ',' soc nouv  ');
set tempstring=replace(tempstring,' societe parisien ',' soc paris  ');
set tempstring=replace(tempstring,' societe parisienne ',' soc paris  ');
set tempstring=replace(tempstring,' societe parisienn ',' soc paris  ');
set tempstring=replace(tempstring,' societe techniques ',' soc tech  ');
set tempstring=replace(tempstring,' societe technique ',' soc tech  ');
set tempstring=replace(tempstring,' sdruzeni podniku ',' sp  ');
set tempstring=replace(tempstring,' sdruzeni podnik ',' sp  ');
set tempstring=replace(tempstring,' societa per azioni ',' spa ');
set tempstring=replace(tempstring,' spitalul ',' spital ');
set tempstring=replace(tempstring,' societe privee a responsabilite limitee ',' sprl ');
set tempstring=replace(tempstring,' sociedad de responsabilidad limitada ',' srl  ');
set tempstring=replace(tempstring,' stiintifica ',' stiint ');
set tempstring=replace(tempstring,' suddeutsch ',' suddeut ');
set tempstring=replace(tempstring,' suddeutsches ',' suddeut ');
set tempstring=replace(tempstring,' suddeutscher ',' suddeut ');
set tempstring=replace(tempstring,' suddeutsche ',' suddeut ');
set tempstring=replace(tempstring,' technical ',' tech ');
set tempstring=replace(tempstring,' technico ',' tech ');
set tempstring=replace(tempstring,' techniczny ',' tech ');
set tempstring=replace(tempstring,' technik ',' tech ');
set tempstring=replace(tempstring,' technikai ',' tech ');
set tempstring=replace(tempstring,' techniki ',' tech ');
set tempstring=replace(tempstring,' techniques ',' tech ');
set tempstring=replace(tempstring,' technisch ',' tech ');
set tempstring=replace(tempstring,' technisches ',' tech ');
set tempstring=replace(tempstring,' technique ',' tech ');
set tempstring=replace(tempstring,' technische ',' tech ');
set tempstring=replace(tempstring,' telecommunicacion ',' telecom ');
set tempstring=replace(tempstring,' telecommunications ',' telecom ');
set tempstring=replace(tempstring,' telecommunicazioni ',' telecom ');
set tempstring=replace(tempstring,' telecomunicazioni ',' telecom ');
set tempstring=replace(tempstring,' telecommunication ',' telecom ');
set tempstring=replace(tempstring,' trustul ',' trust ');
set tempstring=replace(tempstring,' united kingdom ',' uk ');
set tempstring=replace(tempstring,' secretary of state for ',' uk sec for ');
set tempstring=replace(tempstring,' universidade ',' univ ');
set tempstring=replace(tempstring,' universita ',' univ ');
set tempstring=replace(tempstring,' universita degli studi ',' univ ');
set tempstring=replace(tempstring,' universitaet ',' univ ');
set tempstring=replace(tempstring,' universitaire ',' univ ');
set tempstring=replace(tempstring,' universitat ',' univ ');
set tempstring=replace(tempstring,' universitatea ',' univ ');
set tempstring=replace(tempstring,' universite ',' univ ');
set tempstring=replace(tempstring,' universiteit ',' univ ');
set tempstring=replace(tempstring,' universiteta ',' univ ');
set tempstring=replace(tempstring,' universitetami ',' univ ');
set tempstring=replace(tempstring,' universitete ',' univ ');
set tempstring=replace(tempstring,' universitetom ',' univ ');
set tempstring=replace(tempstring,' universitetov ',' univ ');
set tempstring=replace(tempstring,' universitetu ',' univ ');
set tempstring=replace(tempstring,' universitety ',' univ ');
set tempstring=replace(tempstring,' university ',' univ ');
set tempstring=replace(tempstring,' uniwersytet ',' univ ');
set tempstring=replace(tempstring,' universidad ',' univ ');
set tempstring=replace(tempstring,' universitair ',' univ ');
set tempstring=replace(tempstring,' universitet ',' univ ');
set tempstring=replace(tempstring,' universitetam ',' univ ');
set tempstring=replace(tempstring,' united states ',' us ');
set tempstring=replace(tempstring,' united states of america ',' us ');
set tempstring=replace(tempstring,' united states of america administrator of ',' us admin  ');
set tempstring=replace(tempstring,' united states of america as represented by the united states department ',' us dept  ');
set tempstring=replace(tempstring,' united states government as represented by the secretary of ',' us sec ');
set tempstring=replace(tempstring,' united states of america represented by the secretary ',' us sec ');
set tempstring=replace(tempstring,' united states of america secretary of ',' us sec ');
set tempstring=replace(tempstring,' utilaj ',' util ');
set tempstring=replace(tempstring,' utilaje ',' util ');
set tempstring=replace(tempstring,' utilisations ',' util ');
set tempstring=replace(tempstring,' utilisation ',' util ');
set tempstring=replace(tempstring,' volkseigener betriebe ',' veb  ');
set tempstring=replace(tempstring,' veb kombinat ',' veb komb  ');
set tempstring=replace(tempstring,' verein ',' ver ');
set tempstring=replace(tempstring,' vereinigtes ',' ver ');
set tempstring=replace(tempstring,' vereinigung ',' ver ');
set tempstring=replace(tempstring,' vereniging ',' ver ');
set tempstring=replace(tempstring,' vereinigte ',' ver ');
set tempstring=replace(tempstring,' vereenigde ',' ver  ');
set tempstring=replace(tempstring,' verwaltungen ',' verw ');
set tempstring=replace(tempstring,' verwaltungs ',' verw ');
set tempstring=replace(tempstring,' verwertungs ',' verw ');
set tempstring=replace(tempstring,' verwaltungsgesellschaft ',' verw ges  ');
set tempstring=replace(tempstring,' vyzk ustav ',' vu ');
set tempstring=replace(tempstring,' vyzkumny ustav ',' vu ');
set tempstring=replace(tempstring,' vyzkumnyustav ',' vu ');
set tempstring=replace(tempstring,' vereinigung volkseigener betriebung ',' vvb ');
set tempstring=replace(tempstring,' vyzkumny vyvojovy ustav ',' vvu ');
set tempstring=replace(tempstring,' vyzk vyvojovy ustav ',' vvu  ');
set tempstring=replace(tempstring,' werkzeugmaschinenkombinat ',' werkz masch komb ');
set tempstring=replace(tempstring,' werkzeugmaschinenfabrik ',' werkz maschfab ');
set tempstring=replace(tempstring,' westdeutsch ',' westdeut ');
set tempstring=replace(tempstring,' westdeutsches ',' westdeut ');
set tempstring=replace(tempstring,' westdeutscher ',' westdeut ');
set tempstring=replace(tempstring,' westdeutsche ',' westdeut ');
set tempstring=replace(tempstring,' wissenschaftliches ',' wiss ');
set tempstring=replace(tempstring,' wissenschaftliche ',' wiss ');
set tempstring=replace(tempstring,' wissenschaftliches technisches zentrum ',' wtz  ');
set tempstring=replace(tempstring,' yugen gaisha ',' yg ');
set tempstring=replace(tempstring,' yugen kaisha ',' yg ');
set tempstring=replace(tempstring,' yuugen gaisha ',' yg ');
set tempstring=replace(tempstring,' yuugen kaisha ',' yg ');
set tempstring=replace(tempstring,' yuugen kaisya ',' yg ');
set tempstring=replace(tempstring,' zavodu ',' zavod ');
set tempstring=replace(tempstring,' zavody ',' zavod ');
set tempstring=replace(tempstring,' zentrales ',' zent ');
set tempstring=replace(tempstring,' zentralen ',' zent ');
set tempstring=replace(tempstring,' zentralna ',' zent ');
set tempstring=replace(tempstring,' zentrum ',' zent ');
set tempstring=replace(tempstring,' zentrale ',' zent ');
set tempstring=replace(tempstring,' zentralinstitut ',' zent inst  ');
set tempstring=replace(tempstring,' zentrallaboratorium ',' zent lab  ');
set tempstring=replace(tempstring,' zaidan hojin ',' zh ');
set tempstring=replace(tempstring,' zaidan houjin ',' zh ');


set tempstring=mid(tempstring, 2, CHAR_LENGTH(tempstring)-2); 

RETURN tempstring;

END;

 $$

DELIMITER ;