Avatar billede Slettet bruger
30. april 2002 - 00:12 Der er 39 kommentarer og
1 løsning

Lave 1000 forskellige str_replace om til noget hurtigere?

Ja, jeg er ved at lave en slags ordbog til brug ved oversættelse af undertekster. Den er langt fra perfekt, men sparer en for en del tastearbejde.

I denne har jeg en del str_replace() som bytter norske ord ud med danske.

Lige nu er der omkring 1000, men jeg regner med at det vokser til omkring 2-3000 ord.

Det tager omkring 10 sekunder at køre en tekstfil på omkring 1500 linier igennem, og det kan jeg leve med. Men jo flere ord, jo længere tid.

Hvad er hurtigere end str_replace? Og kan jeg løse det på en anden måde?

PS: du kan da lige tjekke projektet på http://divxit.cliche.dk/translate.php
Avatar billede jakoba Nybegynder
30. april 2002 - 00:22 #1
Det kan godt være det er hurtigere med str replace, men jeg vil nok alligevel anbeflase at du gnaver teksten ord for ord og så for hvert ord slår op om det skal oversættes. ellers kan der ske grimme ting som:

ordbog:
dere  ->  jeres

udsnit af teksten:
... nyttig for mellemledere i tobaksindustriern ...

bliver til:
... nyttig for mellemlejeres i tobaksindustriern ...

sikrere at gå fra tekst til ordbog, men stadig ret farligt. prøv bare "translate this page" linket nederst i den blå kasse her tilvenstre.

mvh JakobA
Avatar billede erikjacobsen Ekspert
30. april 2002 - 00:24 #2
Bruger du ikke regulære udtryk? Der vil jeg tro det kan gå hurtigere.
Og selv JakobA kan sove roligt, for vi kan sagtens sørge for at det kun
er hele ord, det bliver erstattet. Det er da et forsøg værd.
Avatar billede Slettet bruger
30. april 2002 - 00:26 #3
hehe...jepper, den "translate this page" funktion er ikke meget værd.

Men jeg tager teksten ord for ord, og oversætter udelukkende hele ord. Det tager længere tid, men man slipper for dumme fejl.

Problemet er så at man skal tage højde for alle tider og bydemåder. Øv *G*

Min tanke med oversætteren var ikke at den skulle fungere 100%, men tage noget af slavearbejdet væk.
Avatar billede Slettet bruger
30. april 2002 - 00:27 #4
Bare lige top og slut af koden:

///formatterer mht punktum/komma
$string = str_replace("."," . ", $string);
$string = str_replace(","," , ", $string);
$string = str_replace(":"," : ", $string);
$string = str_replace("("," ( ", $string);
$string = str_replace(")"," ) ", $string);
$string = str_replace("-"," - ", $string);
$string = str_replace("'"," ' ", $string);
$string = str_replace("?"," ? ", $string);
$string = str_replace("!"," ! ", $string);
$string = str_replace("´"," ´ ", $string);
$string = str_replace("`"," ` ", $string);
$string = str_replace("}","}. ", $string);
///slut

///lowercase
function casething($theString,$upper) {
return preg_replace("/(\. [a-z]|^[a-z])/mie","strto".($upper ? "upper" : "lower")."('\\1')",$theString);
}

$string = (casething($string,false));
///slut lowercase
$string = str_replace("\r\n"," \r\n ", $string);

///ordliste
$string = str_replace(" trenger "," behøver ", $string);
$string = str_replace(" å "," at ", $string);
$string = str_replace(" inn "," ind ", $string);
$string = str_replace(" bruke "," bruge ", $string);
$string = str_replace(" laget "," lavet ", $string);
$string = str_replace(" knekker "," knækker ", $string);

$string = str_replace(" \r\n ","\r\n", $string);

///uppercase
$string = (caseThing($string,true));
///slut uppercase

///genopretter formattering af punktum/komma
$string = stripslashes($string);
$string = str_replace(" . ",".", $string);
$string = str_replace(" , ",",", $string);
$string = str_replace(" : ",":", $string);
$string = str_replace(" ( ","(", $string);
$string = str_replace(" ) ",")", $string);
$string = str_replace(" - ","-", $string);
$string = str_replace(" ' ","'", $string);
$string = str_replace(" ? ","?", $string);
$string = str_replace(" ! ","!", $string);
$string = str_replace(" ´ ","´", $string);
$string = str_replace(" ` ","`", $string);
$string = str_replace("}. ","}", $string);

///slut
Avatar billede morw Nybegynder
30. april 2002 - 00:29 #5
Man kan vel bare sætte et whitespace foran & bagved og så bruge str_replace
Avatar billede erikjacobsen Ekspert
30. april 2002 - 00:32 #6
Der kan stå komma
Avatar billede Slettet bruger
30. april 2002 - 00:32 #7
De skriver allesammen (på php.net) at str_replace er det hurtigste at bruge. Især når det derjer sig om mange erstatninger. Skal man tro på det?
Avatar billede morw Nybegynder
30. april 2002 - 00:38 #8
ja str_replace er den hurtigste.

Men hvad med at explode på mellemrum og så oversætte ved hjælp af array-opslag?

$sprog['trenger'] = 'behøver';

function oversaet($norsk) {

global $sprog;

if($sprog[$norsk] != '') {
return $sprog[$norsk]; // ord findes på dansk
} else {
return $norsk; // kan ikke erstattes
}

}


Så skal du bare loop'e alle dine ord igennem
Avatar billede erikjacobsen Ekspert
30. april 2002 - 00:42 #9
Nej det skal du ikke tro på el-barto. Dem der siger det, er rene
amatører. Måske er én str_replace burtigere end én med regulære udtryk,
men prøv at putte dine 1000 ord ind i denne og se om den ikke er
hurtigere end 1000 str_replace - og så tager den kun hele ord:

<html>
<head>
</head>

<body>

<?

$fra[] = "/(\W)hus(\W)/i"; $til[] = "$1house$2";
$fra[] = "/(\W)mus(\W)/i"; $til[] = "$1mouse$2";
$fra[] = "/(\W)hund(\W)/i"; $til[] = "$1dog$2";
$fra[] = "/(\W)lus(\W)/i"; $til[] = "$1louse$2";

$s = "Der er en mus i det hus, og det er en husmus";

$t=preg_replace($fra,$til,$s);

print "$s<br>$t<br>";

?>

</body>
</html>
Avatar billede morw Nybegynder
30. april 2002 - 00:47 #10
ej> har du prøvet at tage tid på det? - for str_replace kan jo også tage array som input.
Avatar billede erikjacobsen Ekspert
30. april 2002 - 00:50 #11
Nej, morw. Men jeg får kun hele ord. Og det skal jo være:

$fra[] = "/\bhus\b/i"; $til[] = "house";
$fra[] = "/\bmus\b/i"; $til[] = "mouse";
$fra[] = "/\bhund\b/i"; $til[] = "dog";
$fra[] = "/\blus\b/i"; $til[] = "louse";

Jeg fik vist lige gjort det knap så smart.
Avatar billede Slettet bruger
30. april 2002 - 00:54 #12
Fatal error: Maximum execution time of 30 seconds exceeded in D:\web\clvi23dk_divxit.dk\wwwroot\test2.php on line 4371

Så jeg tror ikke det er hurtigst med preg_replace *G*
Avatar billede morw Nybegynder
30. april 2002 - 00:54 #13
Men str_replace giver også hele ord - dog case-sensitiv

$string = str_replace(" trenger "," behøver ", $string);
Avatar billede jakoba Nybegynder
30. april 2002 - 00:56 #14
morw >> Men der er stadig alle de der endelser:

$string = str_replace(" knekker "," knækker ", $string);
$string = str_replace(" knekkere "," knækkere ", $string);
$string = str_replace(" knekkeren "," knækkeren ", $string);
$string = str_replace(" knekket "," knækket ", $string);

og så bliver det jo noget nemmere hvis man kan oversætte ordet med en enkelt regexp istedetfor 4 str_replacer. Det vil også gøre ordbogen en del mindre.

vistnok (men der er erikjakosens gebet):
$string = preg_replace(" knekke(r|re|ren|t) "," knække$1 ", $string);

er det ikke noget i den retning erikjacobsen?

mvh JakobA
Avatar billede Slettet bruger
30. april 2002 - 00:57 #15
Nu skriver den det ud...men den oversætter ikke.
Avatar billede jakoba Nybegynder
30. april 2002 - 01:14 #16
Øh.. har du forresten overvejet at bruge stavekontrollen i fx Word. Hvis du laver din egen ordbog skulle den da nok kunne gøre det meste af arbejdet.
Avatar billede Noone Nybegynder
30. april 2002 - 04:49 #17
strtr kunne måske bruges, ved dog ikke om den er hurtigere...
Avatar billede erikjacobsen Ekspert
30. april 2002 - 06:32 #18
oversætter ikke? Hvad laver du da el_b ?

Men det kan da godt være jeg har for stor tiltro til hastighed for
preg_replace, med 2 lister som parameter. Jeg har vist heller aldrig
proppet så meget i den ;)  Den ultimative test er jo egentlig også
på en Unix-maskiner *g*

jakoba: jo, det er vist rigtigt med endelserne. Den var nok ikke
brugbar hvis vi oversatte norsk til serbokroatisk....;)

el_b: Hvis det er en rå-oversættelse, hvorfor betyder tiden så noget?
Og hvorfor køre den via en webserver og ikke bare som et prgram på
arbejdsstation?
Avatar billede morw Nybegynder
30. april 2002 - 09:17 #19
En lille test:

Egen server: http://o0o.dk/tid.php

100000 gentagelser på en FreeBSD med Apache/1.3.23 (Unix) PHP/4.1.2
Did preg_replace in 2.9136430025101 seconds
Did str_replace in 1.9296060800552 seconds
Forskel på 0.98403692245483 seconds


Hos udbyder med dual-processer 1 GB ram o.s.v.

100000 gentagelser på en Solaris med Apache/1.3.19 Ben-SSL/1.42 (Unix) PHP/4.1.2
Did preg_replace in 3.9495220184326 seconds
Did str_replace in 2.8541079759598 seconds
Forskel på 1.0954140424728 seconds
Avatar billede tipsen Nybegynder
30. april 2002 - 09:21 #20
SPAM: ...det må være sådanne programmer de bruger til flere og flere af programmerne på TV... - det kan hvertfald forklare de til tider totalt miserable oversættelser...
Avatar billede morw Nybegynder
30. april 2002 - 09:23 #21
Hos anden udbyder digiweb:

100000 gentagelser med PHP 3
Did preg_replace in 18.926290035248 seconds
Did str_replace in 7.7930339574814 seconds
Forskel på 11.133256077766 seconds

100000 gentagelser med PHP 4
Did preg_replace in 5.9094120264053 seconds
Did str_replace in 4.8051429986954 seconds
Forskel på 1.10426902771 seconds
Avatar billede tipsen Nybegynder
30. april 2002 - 09:53 #22
morw: Hvad kan du bruge den test til?

Det ErikJacobsen siger, er at et kald til preg_replace med 1000 ord er hurtigere end 1000 kald til str_replace med 1 ord - udfaldet af den test du laver er meget oplagt, men det overrasker dog at forskellen ikke er større...
Avatar billede jakoba Nybegynder
30. april 2002 - 10:02 #23
Den sidste her er da interresant.
forskellen far php3(18.9) til php4(5.9) er så stor at der næsten må være strammet op på implementereingen af preg_replace() indimellem.
Men det kan også godt være det blot er serverbelastningen fra andre digiveb-kunder vi ser.
Avatar billede erikjacobsen Ekspert
30. april 2002 - 10:30 #24
morw: Det du gør er at lave arrays til både preg_replace
og str_replace, ikke? Med mange i? Er det kun ord, uden
antydning af "regulært udtryk" i, så skal man da bruge
str_replace.

Men jeg bruger netop \b til at afgrænse ord med, og det
kan man af gode grunde ikke i str_replace. Og så må det
gerne koste lidt ekstra.

Og så skal man vist op i PHP 4.0.5 før arrays i str_replace
virker.
Avatar billede morw Nybegynder
30. april 2002 - 11:38 #25
erikjacobsen> Forstår ikke hvad du mener, da mellemrumet før og efter ordet i min str_replace har samme virkning som dine \b. Eneste fordel ved preg_replace i dette tilfælde er at den ikke er casesensitiv.
Avatar billede Slettet bruger
30. april 2002 - 11:57 #26
Jeg er stået af...fatter 0% af hvad i snakker om *G*

Grunden til at lave den som en webapplikation er at andre skal kunne bruge den. Man kunne jo også lave den i C eller Visual Basic, men det tror jeg giver for meget ævl og kævl fra mine brugere...
Avatar billede erikjacobsen Ekspert
30. april 2002 - 12:45 #27
Nej, mellemrum giver jo ikke det samme. Det har jeg sagt før.

  Snoren knekker, en gang imellem.

Der bliver den ikke erstattet af dig - men af mig. Man får mere
med regulære udtryk, så det må også godt koste lidt mere.

el_barto....bliv da hængende...det kunne være en af os skal
afprøve diverse muligheder med dine rigtige data, for at finde
den bedste løsning.
Avatar billede morw Nybegynder
30. april 2002 - 14:21 #28
Jo, hvis man lige replacer de kommaer o.s.v som der er i teksten. Tror godt det kan betale sig når man kigger på hvor meget hurtigere str_replace er.

$string = str_replace(","," , ", $string);

Sprøgsmålet er hvor meget testen vil ændre sig med en længere tekst.
Avatar billede tipsen Nybegynder
30. april 2002 - 14:40 #29
Skal vi snart have en dyst? Vi vil se nogle indledende tidskørsler :-)
Avatar billede morw Nybegynder
30. april 2002 - 14:43 #30
Så giv os noget realworld data. ;-D
Avatar billede erikjacobsen Ekspert
30. april 2002 - 14:53 #31
men morw: laver du en streng-streng replace, eller en
array-array replace. Den første er blevet målt mange gange,
den anden er jeg usikker på, fordi den nemmeste måde
at lave en str_replace med to arrays er ganske simpelt at
oversætte den til et regulært udtryk (efter at taget højde for
de eventuelle sjove teg, der kunne være i den)
Avatar billede morw Nybegynder
30. april 2002 - 14:58 #32
Det var med en array-array: Koden er der også: http://o0o.dk/tid.php
Avatar billede Slettet bruger
02. maj 2002 - 12:31 #33
Realworld-data til jeres forsøg:

///ordliste
$string = str_replace(" trenger "," behøver ", $string);
$string = str_replace(" å "," at ", $string);
$string = str_replace(" inn "," ind ", $string);
$string = str_replace(" bruke "," bruge ", $string);
$string = str_replace(" laget "," lavet ", $string);
$string = str_replace(" knekker "," knækker ", $string);
$string = str_replace(" kodingen "," koden ", $string);
$string = str_replace(" palta "," pladen ", $string);
$string = str_replace(" programmet "," program ", $string);
$string = str_replace(" lovlig "," lovligt ", $string);
$string = str_replace(" ettersom "," eftersom ", $string);
$string = str_replace(" gjeldende "," gældende ", $string);
$string = str_replace(" versjonen "," version ", $string);
$string = str_replace(" av "," af ", $string);
$string = str_replace(" bildet "," billedet ", $string);
$string = str_replace(" lastes ned "," downloades ", $string);
$string = str_replace(" offisielle "," officielle ", $string);
$string = str_replace(" hjemmesiden "," hjemmeside ", $string);
$string = str_replace(" brukt "," have brugt ", $string);
$string = str_replace(" innebygde "," indbyggede ", $string);
$string = str_replace(" hadde "," havde ", $string);
$string = str_replace(" filene "," filerne ", $string);
$string = str_replace(" blitt "," blevet ", $string);
$string = str_replace(" mellom "," mellem ", $string);
$string = str_replace(" tenkt til "," tænkt mig ", $string);
$string = str_replace(" bruke "," bruge ", $string);
$string = str_replace(" etter "," efter ", $string);
$string = str_replace(" gir "," giver ", $string);
$string = str_replace(" beste "," bedste ", $string);
$string = str_replace(" lyden "," lyd ", $string);
$string = str_replace(" Last ned "," Download ", $string);
$string = str_replace(" ut "," ud ", $string);
$string = str_replace(" kjekt "," godt ", $string);
$string = str_replace(" ha "," have ", $string);
$string = str_replace(" brukte "," brugte ", $string);
$string = str_replace(" heter ", " hedder ", $string);
$string = str_replace(" antar "," antager ", $string);
$string = str_replace(" skjønt "," i forvejen ", $string);
$string = str_replace(" tenkte "," tænkte ", $string);
$string = str_replace(" si "," sige ", $string);
$string = str_replace(" tar "," tager ", $string);
$string = str_replace(" veldig "," temmelig ", $string);
$string = str_replace(" prøvd "," prøvet ", $string);
$string = str_replace(" nå "," nu ", $string);
$string = str_replace(" minne "," RAM ", $string);
$string = str_replace(" tok "," tog ", $string);
$string = str_replace(" halvannen "," halvanden ", $string);
$string = str_replace(" litt "," lidt ", $string);
$string = str_replace(" kjører "," kører ", $string);
$string = str_replace(" prosessen "," proces ", $string);
$string = str_replace(" rundt "," omkring ", $string);
$string = str_replace(" gjerne "," gerne ", $string);
$string = str_replace(" ressurser "," ressourcer ", $string);
$string = str_replace(" dersom "," hvis ", $string);
$string = str_replace(" raskere "," hurtigere ", $string);
$string = str_replace(" fall "," fald ", $string);
$string = str_replace(" noe "," noget ", $string);
$string = str_replace(" holder på "," er i gang ", $string);
$string = str_replace(" sette den på "," tænde ", $string);
$string = str_replace(" legger "," lægger ", $string);
$string = str_replace(" ferdig "," færdig ", $string);
$string = str_replace(" tilbake "," tilbage ", $string);
$string = str_replace(" filmer "," film ", $string);
$string = str_replace(" da "," så ", $string);
$string = str_replace(" klare "," klar ", $string);
$string = str_replace(" begynne "," begynde ", $string);
$string = str_replace(" demonstrasjonen "," demonstration ", $string);
$string = str_replace(" blir "," bliver ", $string);
$string = str_replace(" fyrer i gang "," starter ", $string);
$string = str_replace(" bilde "," billede ", $string);
$string = str_replace(" fargene dine "," dine farver ", $string);
$string = str_replace(" nekter "," nægter ", $string);
$string = str_replace(" rask "," hurtig ", $string);
$string = str_replace(" filtypene "," filtyperne ", $string);
$string = str_replace(" oss "," os ", $string);
$string = str_replace(" deretter "," derefter ", $string);
$string = str_replace(" redusere "," reducere ", $string);
$string = str_replace(" mengden "," mængden ", $string);
$string = str_replace(" lagre "," gemme ", $string);
$string = str_replace(" gjennom "," gennem ", $string);
$string = str_replace(" verktøy "," værktøj ", $string);
$string = str_replace(" lar "," lader ", $string);
$string = str_replace(" bruker "," bruger ", $string);
$string = str_replace(" seg "," sig ", $string);
$string = str_replace(" lenge "," længe ", $string);
$string = str_replace(" sloss "," sloges ", $string);
$string = str_replace(" gikk "," gik ", $string);
$string = str_replace(" tapt "," tabt ", $string);
$string = str_replace(" seirende "," sejrende ", $string);
$string = str_replace(" enn "," end ", $string);
$string = str_replace(" internasjonalt "," internationalt ", $string);
$string = str_replace(" aksepterte "," accepterede ", $string);
$string = str_replace(" kløktige "," kløgtige ", $string);
$string = str_replace(" hjernene "," hjerner ", $string);
$string = str_replace(" fullskjerms "," fuldskærms ", $string);
$string = str_replace(" forsøk "," forsøg ", $string);
$string = str_replace(" åpent "," åbent ", $string);
$string = str_replace(" lettvekteren "," letvægteren ", $string);
$string = str_replace(" høye "," høje ", $string);
$string = str_replace(" oppløsning "," opløsning ", $string);
$string = str_replace(" uten "," uden ", $string);
$string = str_replace(" spesifikt "," specifikt ", $string);
$string = str_replace(" noen "," nogen ", $string);
$string = str_replace(" uten "," uden ", $string);
$string = str_replace(" bilderate "," billedrate ", $string);
$string = str_replace(" inneholde "," indeholde ", $string);
$string = str_replace(" bildene "," billeder ", $string);
$string = str_replace(" leppe "," læbe ", $string);
$string = str_replace(" grunn "," grund ", $string);
$string = str_replace(" tapte "," tabte ", $string);
$string = str_replace(" bilder "," billeder ", $string);
$string = str_replace(" avspilling "," afspilning ", $string);
$string = str_replace(" komprimert "," komprimeret ", $string);
$string = str_replace(" kompresjon "," kompression ", $string);
$string = str_replace(" betyr "," betyder ", $string);
$string = str_replace(" oppgis "," opgives ", $string);
$string = str_replace(" ta "," tage ", $string);
$string = str_replace(" ett "," et ", $string);
$string = str_replace(" mer "," mere ", $string);
$string = str_replace(" mye "," meget ", $string);
$string = str_replace(" minusene "," minuser ", $string);
$string = str_replace(" lengre "," længere ", $string);
$string = str_replace(" gjør "," gør ", $string);
$string = str_replace(" igjen "," igen ", $string);
$string = str_replace(" lengre "," længere ", $string);
$string = str_replace(" nevnes "," nævnes ", $string);
$string = str_replace(" angir "," angiver ", $string);
$string = str_replace(" angis "," angives ", $string);
$string = str_replace(" representeres "," repræsenteres ", $string);
$string = str_replace(" komprimerte "," komprimerede ", $string);
$string = str_replace(" Dess "," Des ", $string);
$string = str_replace(" høyere "," højere ", $string);
$string = str_replace(" vanlig "," normalt ", $string);
$string = str_replace(" kreve "," kræve ", $string);
$string = str_replace(" tilbyr "," tilbyder ", $string);
$string = str_replace(" annet "," andet ", $string);
$string = str_replace(" tap "," tab ", $string);
$string = str_replace(" sjanse "," chance ", $string);
$string = str_replace(" bli "," blive ", $string);
$string = str_replace(" krever "," kræver ", $string);
$string = str_replace(" prosessorkraft "," processorkraft ", $string);
$string = str_replace(" åpen "," åben ", $string);
$string = str_replace(" tittelen "," titlen ", $string);
$string = str_replace(" lager "," laver ", $string);
$string = str_replace(" øke "," øge ", $string);
$string = str_replace(" blant "," blandt ", $string);
$string = str_replace(" setter "," stiller ", $string);
$string = str_replace(" i tillegg "," oven i købet ", $string);
$string = str_replace(" maskinvare "," hardware ", $string);
$string = str_replace(" spesiell "," speciel ", $string);
$string = str_replace(" programvare "," software ", $string);
$string = str_replace(" dekke "," dække ", $string);
$string = str_replace(" årrerekke "," årrække ", $string);
$string = str_replace(" fungert "," fungeret ", $string);
$string = str_replace(" kompresjonstandard "," kompressionsstandard ", $string);
$string = str_replace(" aldri "," aldrig ", $string);
$string = str_replace(" vært "," været ", $string);
$string = str_replace(" storslager "," hit ", $string);
$string = str_replace(" lett "," let ", $string);
$string = str_replace(" gjengi "," gengive ", $string);
$string = str_replace(" innen "," indenfor ", $string);
$string = str_replace(" forskjellige "," forskellige ", $string);
$string = str_replace(" kompresjonsmetode "," kompressionsmetode ", $string);
$string = str_replace(" gjennomsnittlige "," gennemsnitlige ", $string);
$string = str_replace(" finnes "," findes ", $string);
$string = str_replace(" internasjonale "," internationale ", $string);
$string = str_replace(" godkjente "," godkendte ", $string);
$string = str_replace(" bevegelige "," bevægelige ", $string);
$string = str_replace(" utbredt "," udbredt ", $string);
$string = str_replace(" ennå "," endnu ", $string);
$string = str_replace(" forskjellige "," forskellige ", $string);
$string = str_replace(" fremst "," fremmest ", $string);
$string = str_replace(" algoritmene "," algoritmerne ", $string);
$string = str_replace(" forsøkt "," forsøgt ", $string);
$string = str_replace(" resultert "," resulteret ", $string);
$string = str_replace(" ute "," ude ", $string);
$string = str_replace(" tilhengere "," tilhængere ", $string);
$string = str_replace(" åpen "," åben ", $string);
$string = str_replace(" dekompilert "," dekompileret ", $string);
$string = str_replace(" kalt "," kaldet ", $string);
$string = str_replace(" formatene "," formater ", $string);
$string = str_replace(" bildekvalitet "," billedkvalitet ", $string);
$string = str_replace(" liten "," lidt ", $string);
$string = str_replace(" krever "," kræver ", $string);
$string = str_replace(" oppnå "," opnå ", $string);
$string = str_replace(" høy "," høj ", $string);
$string = str_replace(" lite "," få ", $string);
$string = str_replace(" skyter "," skyder ", $string);
$string = str_replace(" kompromiss "," kompromis ", $string);
$string = str_replace(" best "," bedst ", $string);
$string = str_replace(" kompresjonsstandarder "," kompressionsstandarder ", $string);
$string = str_replace(" siste "," sidste ", $string);
$string = str_replace(" ditt "," dit ", $string);
$string = str_replace(" begrenset "," begrænset ", $string);
$string = str_replace(" tillate "," tillade ", $string);
$string = str_replace(" brukeren "," brugeren ", $string);
$string = str_replace(" angi "," angive ", $string);
$string = str_replace(" kanskje "," måske ", $string);
$string = str_replace(" faller "," falder ", $string);
$string = str_replace(" derimot "," derimod ", $string);
$string = str_replace(" omdiskuterte "," omdiskuterede ", $string);
$string = str_replace(" innen "," inden ", $string);
$string = str_replace(" selvstendig "," selvstændig ", $string);
$string = str_replace(" basert "," baseret ", $string);
$string = str_replace(" bevegelse "," bevægelse ", $string);
$string = str_replace(" bakgrunnen "," baggrunden ", $string);
$string = str_replace(" deler "," dele ", $string);
$string = str_replace(" dernest "," dernæst ", $string);
$string = str_replace(" neste "," næste ", $string);
$string = str_replace(" endringer "," ændringer ", $string);
$string = str_replace(" reduseres "," reduceres ", $string);
$string = str_replace(" betraktelig "," betragteligt ", $string);
$string = str_replace(" avgjør "," afgører ", $string);
$string = str_replace(" originalbildet "," originalbilledet ", $string);
$string = str_replace(" bildekvaliteten "," billedkvaliteten ", $string);
$string = str_replace(" kompresjonsmetoder "," kompressionsmetoder ", $string);
$string = str_replace(" kvalitetsforskjellene "," kvalitetsforskellene ", $string);
$string = str_replace(" kompresjonsmetodene "," kompressionsmetoder ", $string);
$string = str_replace(" finnes "," findes ", $string);
$string = str_replace(" tilgjengelige "," tilgængelige ", $string);
$string = str_replace(" sett "," set ", $string);
$string = str_replace(" dessverre "," desværre ", $string);
$string = str_replace(" merkbart "," mærkbar ", $string);
$string = str_replace(" I tillegg "," Desuden ", $string);
$string = str_replace(" i tillegg "," desuden ", $string);
$string = str_replace(" viktig "," vigtig ", $string);
$string = str_replace(" Dessverre "," Desværre ", $string);
$string = str_replace(" dessverre "," desværre ", $string);
$string = str_replace(" doble "," fordoble ", $string);
$string = str_replace(" internett "," internettet ", $string);
$string = str_replace(" forsøket "," forsøg ", $string);
$string = str_replace(" dessverre "," desværre ", $string);
$string = str_replace(" rykte "," rygte ", $string);
$string = str_replace(" sanntid "," realtime ", $string);
$string = str_replace(" Sanntid "," Realtime ", $string);
$string = str_replace(" kompresjonsforhold "," kompressionsforhold ", $string);
$string = str_replace(" bitratekontroll "," bitratekontrol ", $string);
$string = str_replace(" misbrukt "," misbrugt ", $string);
$string = str_replace(" videokompresjon "," videokompression ", $string);
$string = str_replace(" samarbeid "," samarbejde ", $string);
$string = str_replace(" videodistribusjon "," videodistribution ", $string);
$string = str_replace(" plass "," plads ", $string);
$string = str_replace(" innføring "," introduktion ", $string);
$string = str_replace(" oversikt "," oversigt ", $string);
$string = str_replace(" hvorav "," hvoraf ", $string);
$string = str_replace(" kvalitetstap "," kvalitetstab ", $string);
$string = str_replace(" kopigenerasjon "," kopigeneration ", $string);
$string = str_replace(" begrensninger "," begrænsninger ", $string);
$string = str_replace(" skapte "," skabte ", $string);
$string = str_replace(" representasjon "," repræsentation ", $string);
$string = str_replace(" profesjonelle "," professionelle ", $string);
$string = str_replace(" motsetning "," modsætning ", $string);
$string = str_replace(" generasjon "," generation ", $string);
$string = str_replace(" sitt "," sit ", $string);
$string = str_replace(" fortsatt "," fortsat ", $string);
$string = str_replace(" jobbe "," arbejde ", $string);
$string = str_replace(" vår "," vores ", $string);
$string = str_replace(" hensiktsmessig "," hensigtsmæssigt ", $string);
$string = str_replace(" slik "," således ", $string);
$string = str_replace(" tak "," fat ", $string);
$string = str_replace(" elementene "," elementer ", $string);
$string = str_replace(" lagret "," gemt ", $string);
$string = str_replace(" representert "," repræsenteret ", $string);
$string = str_replace(" romoppløsning "," opløsning ", $string);
$string = str_replace(" bygd "," bygget ", $string);
$string = str_replace(" opp "," op ", $string);
$string = str_replace(" odde "," forskellige ", $string);
$string = str_replace(" like "," ens ", $string);
$string = str_replace(" linjer "," linier ", $string);
$string = str_replace(" kalles "," kaldes ", $string);
$string = str_replace(" borti "," over i ", $string);
$string = str_replace(" forskjell "," forskel ", $string);
$string = str_replace(" ganger "," gange ", $string);
$string = str_replace(" bilderatet "," billedraten ", $string);
$string = str_replace(" gi "," give ", $string);
$string = str_replace(" annenhver "," hveranden ", $string);
$string = str_replace(" datamaskin "," computer ", $string);
$string = str_replace(" videobildet "," videobilledet ", $string);
$string = str_replace(" oppstå "," opstå ", $string);
$string = str_replace(" vanlige "," almindelige ", $string);
$string = str_replace(" faktoren "," faktor ", $string);
$string = str_replace(" referer "," refererer ", $string);
$string = str_replace(" antall "," antal ", $string);
$string = str_replace(" farger "," farver ", $string);
$string = str_replace(" skjermen "," skærmen ", $string);
$string = str_replace(" farger "," farver ", $string);
$string = str_replace(" forskjellig "," forskellige ", $string);
$string = str_replace(" vanlige "," almindelige ", $string);
$string = str_replace(" sammenheng "," sammenhæng ", $string);
$string = str_replace(" nivå "," niveau ", $string);
$string = str_replace(" fargedybde "," farvedybde ", $string);
$string = str_replace(" antall "," antal ", $string);
$string = str_replace(" oppløsninger "," opløsninger ", $string);
$string = str_replace(" oppløsningene "," opløsningerne ", $string);
$string = str_replace(" datamaskiner "," computere ", $string);
$string = str_replace(" fargeformatene "," farveformaterne ", $string);
$string = str_replace(" sammenheng "," sammenhæng ", $string);
$string = str_replace(" videooppløsning "," videoopløsning ", $string);
$string = str_replace(" dataskjermens "," computerskærmens ", $string);
$string = str_replace(" fullt "," fuldt ", $string);
$string = str_replace(" dataskjermer "," computerskærme ", $string);
$string = str_replace(" betraktning "," betragtning ", $string);
$string = str_replace(" likt "," ens ", $string);
$string = str_replace(" videoinformasjon "," videoinformation ", $string);
$string = str_replace(" sluttresultat "," slutresultatet ", $string);
$string = str_replace(" bra "," godt ", $string);
$string = str_replace(" fullskjermskvalitet "," fuldskærmskvalitet ", $string);
$string = str_replace(" farge "," farve ", $string);
$string = str_replace(" bilderater "," billedrater ", $string);
$string = str_replace(" øker "," øger ", $string);
$string = str_replace(" kraver "," kravet ", $string);
$string = str_replace(" prosesseringskraft "," processorkraft ", $string);
$string = str_replace(" lagringsplass "," lagringkapacitet ", $string);
$string = str_replace(" kjapt "," lille ", $string);
$string = str_replace(" finner "," finder ", $string);
$string = str_replace(" fargeoppløsning "," farveopløsning ", $string);
$string = str_replace(" piksel "," pixel ", $string);
$string = str_replace(" datamaskins "," computers ", $string);
$string = str_replace(" databuss "," databus ", $string);
$string = str_replace(" brukere "," brugere ", $string);
$string = str_replace(" måten "," måden ", $string);
$string = str_replace(" presentasjoner "," præsentationer ", $string);
$string = str_replace(" applikasjonen "," programmet ", $string);
$string = str_replace(" kjøre "," køre ", $string);
$string = str_replace(" kvalitetstapet "," kvalitetstab ", $string);
$string = str_replace(" nesten "," næsten ", $string);
$string = str_replace(" kreves "," kræves ", $string);
$string = str_replace(" kapasiteten "," kapaciteten ", $string);
$string = str_replace(" neppe "," næppe ", $string);
$string = str_replace(" nøye sig "," nøjes ", $string);
$string = str_replace(" drøyt "," omtrent ", $string);
$string = str_replace(" oppløsningen "," opløsning ", $string);
$string = str_replace(" tenke "," tænke ", $string);
$string = str_replace(" alltid "," altid ", $string);
$string = str_replace(" generasjonstap "," generationstab ", $string);
$string = str_replace(" opphav "," ophav ", $string);
$string = str_replace(" mengder "," mængder ", $string);
$string = str_replace(" hovednøkklene "," hovednøglerne ", $string);
$string = str_replace(" i utgangspunktet "," som udgangspunkt ", $string);
$string = str_replace(" innvolverte "," indvolverede ", $string);
$string = str_replace(" klarte "," klarede ", $string);
$string = str_replace(" avsløre "," afsløre ", $string);
$string = str_replace(" baserte "," baserede ", $string);
$string = str_replace(" opplysninger "," oplysninger ", $string);
$string = str_replace(" mangefult "," mangefuldt ", $string);
$string = str_replace(" hevdes "," hævdes ", $string);
$string = str_replace(" programme "," programmet ", $string);
$string = str_replace(" rutinene "," rutinerne ", $string);
$string = str_replace(" måte "," måde ", $string);
$string = str_replace(" annen "," anden ", $string);
$string = str_replace(" programererne "," programørerne ", $string);
$string = str_replace(" ryktene "," rygterne ", $string);
$string = str_replace(" inntil "," indtil ", $string);
$string = str_replace(" tilfelle "," tilfælde ", $string);
$string = str_replace(" missbrukt "," misbrugt ", $string);
$string = str_replace(" utganspunkt "," udgangspunkt ", $string);
$string = str_replace(" oppdagede "," opdagede ", $string);
$string = str_replace(" inneholder "," indeholder ", $string);
$string = str_replace(" fått "," fået ", $string);
$string = str_replace(" titt "," kig ", $string);
$string = str_replace(" finne "," finde ", $string);
$string = str_replace(" leses "," læses ", $string);
$string = str_replace(" innholdsfortegnelse "," indholdsfortegnelse ", $string);
$string = str_replace(" platen "," pladen ", $string);
$string = str_replace(" kontrollfiler "," kontrolfiler ", $string);
$string = str_replace(" plater "," plader ", $string);
$string = str_replace(" inneholder "," indeholder ", $string);
$string = str_replace(" videoinformasjonen "," videoinformationen ", $string);
$string = str_replace(" kontrollpakke "," kontrolpakke ", $string);
$string = str_replace(" diveres "," diverse ", $string);
$string = str_replace(" navigasjonsinformasjon "," navigationsinformation ", $string);
$string = str_replace(" gjennomgangen "," gennemgang ", $string);
$string = str_replace(" vindu "," vindue ", $string);
$string = str_replace(" velger "," vælger ", $string);
$string = str_replace(" begynner "," begynder ", $string);
$string = str_replace(" menyene "," menuerne ", $string);
$string = str_replace(" destinasjonsstedet "," destinationsstedet ", $string);
$string = str_replace(" dekrypterte "," dekrypterede ", $string);
$string = str_replace(" avbryte "," afbryde ", $string);
$string = str_replace(" informasjonsvinduet "," informationsvinduet ", $string);
$string = str_replace(" gjenstår "," mangler ", $string);
$string = str_replace(" skjøte "," kæde ", $string);
$string = str_replace(" kjempestor "," kæmpestor ", $string);
$string = str_replace(" krysse "," krydse ", $string);
$string = str_replace(" fort "," hurtigt ", $string);
$string = str_replace(" avhenger "," afhænger ", $string);
$string = str_replace(" lesehastigheten "," læsehastigheden ", $string);
$string = str_replace(" spillern "," spilleren ", $string);
$string = str_replace(" skrivehastigheten "," skrivehastigheden ", $string);
$string = str_replace(" vanlige "," normale ", $string);
$string = str_replace(" disker "," diske ", $string);
$string = str_replace(" kryptert "," krypteret ", $string);
$string = str_replace(" programvarebasert "," softwarebaseret ", $string);
$string = str_replace(" prosessorsykler "," processortakter ", $string);
$string = str_replace(" ferdige "," færdige ", $string);
$string = str_replace(" døpe om "," omdøbe ", $string);
$string = str_replace(" filutvidelsen "," filendelsen ", $string);
$string = str_replace(" menysystemet "," menusystemet ", $string);
$string = str_replace(" avspillerprogrammene "," afspillerprogrammerne ", $string);
$string = str_replace(" foldern "," folder ", $string);
$string = str_replace(" rot "," rod ", $string);
$string = str_replace(" avspilling "," afspilning ", $string);
$string = str_replace(" velge "," vælge ", $string);
$string = str_replace(" krets "," kreds ", $string);
$string = str_replace(" intervall "," interval ", $string);
$string = str_replace(" skjer "," sker ", $string);
$string = str_replace(" såkalte "," såkaldte ", $string);
$string = str_replace(" lik "," lig ", $string);
$string = str_replace(" nivåer "," niveauer ", $string);
$string = str_replace(" plate "," plade ", $string);
$string = str_replace(" tall "," tal ", $string);
$string = str_replace(" multiplisert "," ganget ", $string);
$string = str_replace(" hva "," hvad ", $string);
$string = str_replace(" opptil "," op til ", $string);
$string = str_replace(" informasjon "," information ", $string);
$string = str_replace(" bitreduksjon "," bitreduktion ", $string);
$string = str_replace(" lese "," læse ", $string);
$string = str_replace(" potensielt "," potentielt ", $string);
$string = str_replace(" videobilde "," videobillede ", $string);
$string = str_replace(" satt "," sat ", $string);
$string = str_replace(" sjekker "," tjekker ", $string);
$string = str_replace(" muligheter "," muligheder ", $string);
$string = str_replace(" sikkerhetskopier "," sikkerhedskopier ", $string);
$string = str_replace(" eier "," ejer ", $string);
$string = str_replace(" selge "," sælge ", $string);
$string = str_replace(" foretrekker "," foretrækker ", $string);
$string = str_replace(" knapp "," knap ", $string);
$string = str_replace(" legge "," lægge ", $string);
$string = str_replace(" arbeid "," arbejde ", $string);
$string = str_replace(" lønn "," belønning ", $string);
$string = str_replace(" strevet "," arbejdet ", $string);
$string = str_replace(" deg "," dig ", $string);
$string = str_replace(" merke "," mærke ", $string);
$string = str_replace(" innebærer "," indebærer ", $string);
$string = str_replace(" bak "," bag ", $string);
$string = str_replace(" la "," lade ", $string);
$string = str_replace(" oppdateres "," opdateres ", $string);
$string = str_replace(" munnen "," munden ", $string);
$string = str_replace(" beveger "," bevæger ", $string);
$string = str_replace(" sakte "," langsomt ", $string);
$string = str_replace(" søke "," søge ", $string);
$string = str_replace(" egenskapen "," egenskab ", $string);
$string = str_replace(" lagrer "," gemmer ", $string);
$string = str_replace(" all "," al ", $string);
$string = str_replace(" informasjonen "," informationen ", $string);
$string = str_replace(" fila "," filen ", $string);
$string = str_replace(" gunstig "," optimal ", $string);
$string = str_replace(" settes "," sættes ", $string);
$string = str_replace(" endrer "," ændrer ", $string);
$string = str_replace(" fremdeles "," stadig ", $string);
$string = str_replace(" pistolskudd "," pistolskud ", $string);
$string = str_replace(" krevende "," krævende ", $string);
$string = str_replace(" gjennomsnittlig "," gennemsnitlig ", $string);
$string = str_replace(" låte "," lyde ", $string);
$string = str_replace(" gjøre "," gøre ", $string);
$string = str_replace(" sluttfila "," slutfilen ", $string);
$string = str_replace(" sette "," sætte ", $string);
$string = str_replace(" lage "," lave ", $string);
$string = str_replace(" ripp "," rip ", $string);
$string = str_replace(" på nytt "," igen ", $string);
$string = str_replace(" kræsjer "," chrasher ", $string);
$string = str_replace(" fenomenet "," fænomen ", $string);
$string = str_replace(" skjedd "," sket ", $string);
$string = str_replace(" unntak "," undtagelse ", $string);
$string = str_replace(" lasta ned "," downloadet ", $string);
$string = str_replace(" fant "," fandt ", $string);
$string = str_replace(" falt "," faldt ", $string);
$string = str_replace(" fallt "," faldt ", $string);
$string = str_replace(" funksjon "," funktion ", $string);
$string = str_replace(" hater "," hader ", $string);
$string = str_replace(" grunnen "," grunden ", $string);
$string = str_replace(" pleier "," plejer ", $string);
$string = str_replace(" sitter "," sidder ", $string);
$string = str_replace(" fikler "," roder ", $string);
$string = str_replace(" inne "," inde ", $string);
$string = str_replace(" funka "," fungerer ", $string);
$string = str_replace(" frøys "," frøs ", $string);
$string = str_replace(" minutt "," minut ", $string);
$string = str_replace(" håper "," håber ", $string);
$string = str_replace(" hittil "," hidtil ", $string);
$string = str_replace(" annonsert "," annonceret ", $string);
$string = str_replace(" spesialist "," specialist ", $string);
$string = str_replace(" leverandørenes "," leverandøres ", $string);
$string = str_replace(" kjent "," bekendt ", $string);
$string = str_replace(" vinnere "," vinder ", $string);
$string = str_replace(" akseptert "," accepteret ", $string);
$string = str_replace(" utvidet "," udvidet ", $string);
$string = str_replace(" kapasitet "," kapacitet ", $string);
$string = str_replace(" utvikling "," udvikling ", $string);
$string = str_replace(" ble "," blev ", $string);
$string = str_replace(" oppdatert "," opdateret ", $string);
$string = str_replace(" uker "," uger ", $string);
$string = str_replace(" artikkelen "," artikkel ", $string);
$string = str_replace(" tilgjengelig "," tilgængelig ", $string);
$string = str_replace(" gav ud "," udgav ", $string);
$string = str_replace(" produseres "," produceres ", $string);
$string = str_replace(" likner "," ligner ", $string);
$string = str_replace(" framtid "," fremtid ", $string);
$string = str_replace(" opprinnelige "," oprindelige ", $string);
$string = str_replace(" varighet "," varighed ", $string);
$string = str_replace(" tilstrekkelig "," tilstrækkelig ", $string);
$string = str_replace(" oppstått "," oppstået ", $string);
$string = str_replace(" organisasjonen "," organisationen ", $string);
$string = str_replace(" ulike "," forskellige ", $string);
$string = str_replace(" årsaker "," årsager ", $string);
$string = str_replace(" produsentene "," producenterne ", $string);
$string = str_replace(" produsenter "," producenter ", $string);
$string = str_replace(" inkludert "," inkluderet ", $string);
$string = str_replace(" utviklet "," udviklet ", $string);
$string = str_replace(" avhengig "," afhængig ", $string);
$string = str_replace(" innkapsling "," indkapsling ", $string);
$string = str_replace(" rekke "," række ", $string);
$string = str_replace(" lanserte "," lancerede ", $string);
$string = str_replace(" selskaper "," selskaber ", $string);
$string = str_replace(" utbryteren "," udbrydere ", $string);
$string = str_replace(" hevder "," hævder ", $string);
$string = str_replace(" tradisjonelle "," traditionelle ", $string);
$string = str_replace(" minst "," mindst ", $string);
$string = str_replace(" forskjellen "," forskel ", $string);
$string = str_replace(" innvirkning "," indvirkning ", $string);
$string = str_replace(" seieren "," sejeren ", $string);
$string = str_replace(" foreløpig "," foreløbig ", $string);
$string = str_replace(" mot "," mod ", $string);
$string = str_replace(" endre "," ændre ", $string);
$string = str_replace(" kostnadseffektivt "," kosteffektiv ", $string);
$string = str_replace(" framtidige "," fremtidige ", $string);
$string = str_replace(" lansert "," lanceret ", $string);
$string = str_replace(" komplett "," komplet ", $string);
$string = str_replace(" nevne "," nævne ", $string);
$string = str_replace(" bruk "," brug ", $string);
$string = str_replace(" framstår "," fremstår ", $string);
$string = str_replace(" forsprang "," forspring ", $string);
$string = str_replace(" motstanderne "," modstanderne ", $string);
$string = str_replace(" likevel "," alligevel ", $string);
$string = str_replace(" nettopp "," netop ", $string);
$string = str_replace(" utslaget "," udslag ", $string);
$string = str_replace(" akseptere "," acceptere ", $string);
$string = str_replace(" platene "," pladerne ", $string);
$string = str_replace(" preg "," præg ", $string);
$string = str_replace(" vet "," ved ", $string);
$string = str_replace(" enkeltsidige "," enkeltsidede ", $string);
$string = str_replace(" vant "," vandt ", $string);
$string = str_replace(" eldre "," ældre ", $string);
$string = str_replace(" avklaring "," afklaring ", $string);
$string = str_replace(" sikte "," sigte ", $string);
$string = str_replace(" konspirasjonsteori "," konspirationsteori ", $string);
$string = str_replace(" hensikt "," hensigt ", $string);
$string = str_replace(" forsvinne "," forsvinde ", $string);
$string = str_replace(" brenne "," brænde ", $string);
$string = str_replace(" kjenne "," kende ", $string);
$string = str_replace(" begreper "," begreber ", $string);
$string = str_replace(" konvensjon "," konvention ", $string);
$string = str_replace(" lesing "," læsning ", $string);
$string = str_replace(" leser "," læser ", $string);
$string = str_replace(" kjøpt "," købt  ", $string);
$string = str_replace(" tross "," trods ", $string);
$string = str_replace(" oppgitt "," opgivet ", $string);
$string = str_replace(" sesjon "," session ", $string);
$string = str_replace(" musikk "," musik ", $string);
$string = str_replace(" sesjonen "," session ", $string);
$string = str_replace(" multisesjon "," multisession ", $string);
$string = str_replace(" lenke "," lænke ", $string);
$string = str_replace(" sesjonene "," disse sessions ", $string);
$string = str_replace(" gammle "," gamle ", $string);
$string = str_replace(" brenneoperasjon "," brændingen ", $string);
$string = str_replace(" påbegynt "," påbegyndt ", $string);
$string = str_replace(" avbrytes "," afbrydes ", $string);
$string = str_replace(" avbryter "," afbryder ", $string);
$string = str_replace(" feil "," fejl ", $string);
$string = str_replace(" full "," fuld ", $string);
$string = str_replace(" vanligste "," mest normale ", $string);
$string = str_replace(" feilkorreksjon "," fejlkorrektion ", $string);
$string = str_replace(" brukes "," bruges ", $string);
$string = str_replace(" likhet "," lighed ", $string);
$string = str_replace(" musikk "," musik ", $string);
$string = str_replace(" legges "," lægges ", $string);
$string = str_replace(" forhåpentligvis "," forhåbentligvis ", $string);
$string = str_replace(" høytalerne "," højtalerne ", $string);
$string = str_replace(" CDen "," CD'en ", $string);
$string = str_replace(" CDer "," CD'er ", $string);
$string = str_replace(" innhold "," indhold ", $string);
$string = str_replace(" plattformer "," platforme ", $string);
$string = str_replace(" spesifiserer "," specificerer ", $string);
$string = str_replace(" gjengjeld "," gengæld ", $string);
$string = str_replace(" bruken "," brugen ", $string);
$string = str_replace(" lengde "," længde ", $string);
$string = str_replace(" lesbar "," læsbar ", $string);
$string = str_replace(" etterpå "," derefter ", $string);
$string = str_replace(" bokstaver "," bogstaver ", $string);
$string = str_replace(" maskin "," maskine ", $string);
$string = str_replace(" brukes "," bruges ", $string);
$string = str_replace(" utvidelse "," udvidelse ", $string);
$string = str_replace(" standardene "," standarder ", $string);
$string = str_replace(" enda "," endnu ", $string);
$string = str_replace(" hjelp "," hjælp ", $string);
$string = str_replace(" arbeidet "," arbejde ", $string);
$string = str_replace(" rett frem "," simpelt ", $string);
$string = str_replace(" spør "," spørger ", $string);
$string = str_replace(" bakgrunn "," baggrund ", $string);
$string = str_replace(" riktige "," rigtige ", $string);
$string = str_replace(" brukergrensesnittet "," brugergrænsefladen ", $string);
$string = str_replace(" dreier "," drejer ", $string);
$string = str_replace(" kopiert "," kopieret ", $string);
$string = str_replace(" internasjonal "," international ", $string);
$string = str_replace(" hastigheten  "," hastigheden  ", $string);
$string = str_replace(" filformatene "," filformaterne ", $string);
$string = str_replace(" dataene "," disse data ", $string);
$string = str_replace(" ment for "," beregnet til ", $string);
$string = str_replace(" levert "," leveret ", $string);
$string = str_replace(" DVD-ROM-spillere "," DVD-ROM-afspillere ", $string);
$string = str_replace(" CD-ROM-spillere "," CD-ROM-afspillere ", $string);
$string = str_replace(" DVD-spillere "," DVD-afspillere ", $string);
$string = str_replace(" ferd "," færd ", $string);
$string = str_replace(" artikkel "," artikel ", $string);
$string = str_replace(" overskrivbare "," genkrivbare ", $string);
$string = str_replace(" utgjør "," udgør ", $string);
$string = str_replace(" grensen "," grænse ", $string);
$string = str_replace(" potensiale "," potentiale ", $string);
$string = str_replace(" tvil "," tvivl ", $string);
$string = str_replace(" generasjonen "," generation ", $string);
$string = str_replace(" andregenerasjons "," andengenerations ", $string);
$string = str_replace(" tilleggsutstyret "," tillægsudstyr ", $string);
$string = str_replace(" portabel "," bærbar ", $string);
$string = str_replace(" pc "," PC ", $string);
$string = str_replace(" favorittfilmer "," favoritfilm ", $string);
$string = str_replace(" skryte "," skrige ", $string);
$string = str_replace(" reell "," reel ", $string);
$string = str_replace(" hastighet "," hastighed ", $string);
$string = str_replace(" raskeste "," hurtigste ", $string);
$string = str_replace(" gjelder "," gælder ", $string);
$string = str_replace(" overføring "," overførsel ", $string);
$string = str_replace(" ferd "," færd ", $string);
$string = str_replace(" skje "," ske ", $string);
$string = str_replace(" generasjon "," generation ", $string);
$string = str_replace(" produksjonen "," produktionen ", $string);
$string = str_replace(" komplett "," komplet ", $string);
$string = str_replace(" minstekrav "," mindstekrav ", $string);
$string = str_replace(" glede "," glæde ", $string);
$string = str_replace(" høyttalere "," højttalere ", $string);
$string = str_replace(" skjermkort "," skærmkort ", $string);
$string = str_replace(" tittel "," titel ", $string);
$string = str_replace(" harddiskkontroller "," harddiskcontroller ", $string);
$string = str_replace(" hovedkort "," bundkort ", $string);
$string = str_replace(" hovedprosessoren "," hovedprocessoren ", $string);
$string = str_replace(" frigjøres "," frigøres ", $string);
$string = str_replace(" unngår "," undgår ", $string);
$string = str_replace(" hakkete "," hakkende ", $string);
$string = str_replace(" etterhvert "," efterhånden ", $string);
$string = str_replace(" femti "," halvtreds ", $string);
$string = str_replace(" representant "," repræsentant ", $string);
$string = str_replace(" produsenten "," producenten ", $string);
$string = str_replace(" forteller "," fortæller ", $string);
$string = str_replace(" selskapet "," selskabet ", $string);
$string = str_replace(" brukerne "," brugerne ", $string);
$string = str_replace(" sikt "," sigt ", $string);
$string = str_replace(" selges "," sælges ", $string);
$string = str_replace(" mengde "," mængde ", $string);
$string = str_replace(" sannsynligvis "," sandsynligvis ", $string);
$string = str_replace(" eksplosjonsartet "," eksplosionsagtig ", $string);
$string = str_replace(" framover "," fremover ", $string);
$string = str_replace(" anvendelighet "," anvendelighed ", $string);
$string = str_replace(" mulighet "," mulighed ", $string);
$string = str_replace(" forgjenger "," forgænger ", $string);
$string = str_replace(" sitte "," sidde ", $string);
$string = str_replace(" aksellererende "," accelererende ", $string);
$string = str_replace(" grunner "," grunde ", $string);
$string = str_replace(" framfor "," fremfor ", $string);
$string = str_replace(" framtiden  "," fremtiden ", $string);
$string = str_replace(" tynn "," tynd ", $string);
$string = str_replace(" skjerm "," skærm ", $string);
$string = str_replace(" bildestørrelser "," billedstørrelser ", $string);
$string = str_replace(" muligheten "," muligheden ", $string);
$string = str_replace(" optimalisert "," optimeret ", $string);
$string = str_replace(" fortvil ","  fortvivl", $string);
$string = str_replace(" prosessen "," processen ", $string);
$string = str_replace(" kino "," biograf ", $string);
$string = str_replace(" prosess "," process ", $string);
$string = str_replace(" gjøres "," gøres ", $string);
$string = str_replace(" framvisning "," fremvisning ", $string);
$string = str_replace(" innholdet "," indholdet ", $string);
$string = str_replace(" la "," lad ", $string);
$string = str_replace(" fram "," frem ", $string);
$string = str_replace(" valgmulighetene "," valgmulighederne ", $string);
$string = str_replace(" bildeformat "," billedformat ", $string);
$string = str_replace(" begrepene "," begreb ", $string);
$string = str_replace(" nøkkelen "," nøglen ", $string);
$string = str_replace(" høyden "," højden ", $string);
$string = str_replace(" bildet "," billedet ", $string);
$string = str_replace(" innenfor "," indenfor ", $string);
$string = str_replace(" komplikasjoner "," komplikationer ", $string);
$string = str_replace(" høyde "," højde ", $string);
$string = str_replace(" dager "," dage ", $string);
$string = str_replace(" biograffilmer "," biograffilm ", $string);
$string = str_replace(" samlebegrep "," samlet betegnelse ", $string);
$string = str_replace(" slikt "," sådan ", $string);
$string = str_replace(" opplagt "," oplagt ", $string);
$string = str_replace(" markert "," markeret ", $string);
$string = str_replace(" måter "," måder ", $string);
$string = str_replace(" svarte "," sorte ", $string);
$string = str_replace(" striper "," striber ", $string);
$string = str_replace(" fylle "," fylde ", $string);
$string = str_replace(" oppstår "," opstår ", $string);
$string = str_replace(" plassert "," placeret ", $string);
$string = str_replace(" smalere "," smallere ", $string);
$string = str_replace(" høyden "," højden ", $string);
$string = str_replace(" inn "," ind ", $string);
$string = str_replace(" mye "," meget ", $string);
$string = str_replace(" bildeoppløsningen "," billedopløsningen ", $string);
$string = str_replace(" prosent "," procent ", $string);
$string = str_replace(" stripene "," striber ", $string);
$string = str_replace(" opprinnelig "," oprindelig ", $string);
$string = str_replace(" utgaven "," udgaven ", $string);
$string = str_replace(" snakk "," tale ", $string);
$string = str_replace(" utvalgte "," udvalgte ", $string);
$string = str_replace(" framtiden "," fremtiden ", $string);
$string = str_replace(" lot "," lod ", $string);
$string = str_replace(" vet "," ved ", $string);
$string = str_replace(" gidder "," gider ", $string);
$string = str_replace(" gjerning "," gerning ", $string);
$string = str_replace(" gærning "," psykopat ", $string);
$string = str_replace(" gærningen "," psykopaten ", $string);
$string = str_replace(" buss "," bus ", $string);
$string = str_replace(" passasjerer "," passagerere ", $string);
$string = str_replace(" passasjerene "," passagererne ", $string);
$string = str_replace(" fortell "," fortæl ", $string);
$string = str_replace(" ikke rør dig "," rør dig ikke ", $string);
$string = str_replace(" arrestert "," arresteret ", $string);
$string = str_replace(" helvete "," helvede ", $string);
$string = str_replace(" helvetes "," helvedes ", $string);
$string = str_replace(" sa "," sagde ", $string);
$string = str_replace(" hit "," her ", $string);
$string = str_replace(" forsto "," forstod ", $string);
$string = str_replace(" postfunksjonærer "," postfunktionærerne ", $string);
$string = str_replace(" bussjåførene "," buschauffører ", $string);
$string = str_replace(" nektet "," nægtede ", $string);
$string = str_replace(" meg "," mig ", $string);
$string = str_replace(" gislene "," gidslerne ", $string);
$string = str_replace(" hva "," hvad ", $string);
$string = str_replace(" finn "," find ", $string);
$string = str_replace(" uti "," ud ", $string);
$string = str_replace(" per "," pr ", $string);
$string = str_replace(" hode "," hovede ", $string);
$string = str_replace(" penger "," penge ", $string);
$string = str_replace(" overtar "," overtager ", $string);
$string = str_replace(" dere "," I ", $string);
$string = str_replace(" divisjon "," division ", $string);
$string = str_replace(" kjenner "," kender ", $string);
$string = str_replace(" bra "," godt ", $string);
$string = str_replace(" bestemor "," bedstemor ", $string);
$string = str_replace(" spart "," sparet ", $string);
$string = str_replace(" på vei "," på vej hen ", $string);
$string = str_replace(" jakt "," jagt ", $string);
$string = str_replace(" jobb "," arbejde ", $string);
$string = str_replace(" kjeften "," kæften ", $string);
$string = str_replace(" stygg "," grim ", $string);
$string = str_replace(" visst "," vist ", $string);
$string = str_replace(" vinneren "," vinderen ", $string);
$string = str_replace(" imot "," imod ", $string);
$string = str_replace(" mann "," mand ", $string);
$string = str_replace(" venn "," ven ", $string);
$string = str_replace(" fortsett "," fortsæt med ", $string);
$string = str_replace(" avdeling "," afdeling ", $string);
$string = str_replace(" gått "," gået ", $string);
$string = str_replace(" vedder "," vædder ", $string);
$string = str_replace(" løslatt "," løsladt ", $string);
$string = str_replace(" flyktning "," flygtning ", $string);
$string = str_replace(" bryter "," bryder ", $string);
$string = str_replace(" avtaler "," aftaler ", $string);
$string = str_replace(" sju "," syv ", $string);
$string = str_replace(" hodet "," hovedet ", $string);
$string = str_replace(" fanken "," fandens ", $string);
$string = str_replace(" skyt "," skyd ", $string);
$string = str_replace(" vet "," ved ", $string);
$string = str_replace(" innvoller "," indvolde ", $string);
$string = str_replace(" Situasjonen "," situationen ", $string);
$string = str_replace(" kontroll "," kontrol ", $string);
$string = str_replace(" oppmerksomhet "," opmærksomhed ", $string);
$string = str_replace(" gjester "," gæster ", $string);
$string = str_replace(" langveisfra "," langvejs fra ", $string);
$string = str_replace(" åpninger "," åbninger ", $string);
$string = str_replace(" spørsmål "," spørgsmål ", $string);
$string = str_replace(" eksplosjonen "," eksplosionen ", $string);
$string = str_replace(" eksplosjon "," eksplosion ", $string);
$string = str_replace(" forsiktige "," forsigtige ", $string);
$string = str_replace(" våpnene "," våbene ", $string);
$string = str_replace(" spesielt "," specielt ", $string);
$string = str_replace(" sykepleierne "," lægerne ", $string);
$string = str_replace(" hendte "," skete ", $string);
$string = str_replace(" sånt "," sådan noget ", $string);
$string = str_replace(" vakre "," smukke ", $string);
$string = str_replace(" lenger "," længere ", $string);
$string = str_replace(" jakten "," jagten ", $string);
$string = str_replace(" stopp "," stop ", $string);
$string = str_replace(" dreper "," dræber ", $string);
$string = str_replace(" mislyktes "," fejlede ", $string);
$string = str_replace(" pass "," pas ", $string);
$string = str_replace(" øynene "," øjnene ", $string);
$string = str_replace(" jobber "," arbejder ", $string);
$string = str_replace(" maten "," maden ", $string);
$string = str_replace(" udugelig "," uduelig ", $string);
$string = str_replace(" digre "," kæmpe ", $string);
$string = str_replace(" baken "," røv ", $string);
$string = str_replace(" våpenet "," våbenet ", $string);
$string = str_replace(" mitt "," mit ", $string);
$string = str_replace(" akseptabelt "," acceptabelt ", $string);
$string = str_replace(" sånn "," sådan ", $string);
$string = str_replace(" vann "," vand ", $string);
$string = str_replace(" henger "," hænger ", $string);
$string = str_replace(" mistenkte "," mistænkte ", $string);
$string = str_replace(" blunket "," blinkede ", $string);
$string = str_replace(" øyelokk "," øjenlåg ", $string);
$string = str_replace(" fordoble "," dobbelte ", $string);
$string = str_replace(" billykter "," billygter ", $string);
$string = str_replace(" trakk "," trak ", $string);
$string = str_replace(" røyk "," røg ", $string);
$string = str_replace(" sier "," siger ", $string);
$string = str_replace(" lisensiert "," licensieret ", $string);
$string = str_replace(" tillatt "," tilladt ", $string);
$string = str_replace(" endring "," ændring ", $string);
$string = str_replace(" utleie "," udleje ", $string);
$string = str_replace(" utstilling "," udstilling ", $string);
$string = str_replace(" utlån "," udlån ", $string);
$string = str_replace(" brudd "," brud ", $string);
$string = str_replace(" rettslig "," retsligt ", $string);
$string = str_replace(" undersøke "," undersøge ", $string);
$string = str_replace(" drar "," tager ", $string);
$string = str_replace(" magen "," maven ", $string);
$string = str_replace(" taket "," taget ", $string);
$string = str_replace(" duger "," duer ", $string);
$string = str_replace(" fettknopp "," fedtknop ", $string);
$string = str_replace(" likhuset "," lighuset ", $string);
$string = str_replace(" rettsmedisin "," retsmedicin ", $string);
$string = str_replace(" kveld "," aften ", $string);
$string = str_replace(" gjeller "," gæller ", $string);
$string = str_replace(" andpusten "," forpustet ", $string);
$string = str_replace(" sa "," sagde ", $string);
$string = str_replace(" gjenkjenne "," genkende ", $string);
$string = str_replace(" uten "," uden ", $string);
$string = str_replace(" fots "," fods ", $string);
$string = str_replace(" sterkt "," stærkt ", $string);
$string = str_replace(" byrå "," bureau ", $string);
$string = str_replace(" overvåker "," overvåger ", $string);
$string = str_replace(" selger "," sælger ", $string);
$string = str_replace(" våpen "," våben ", $string);
$string = str_replace(" avskyr "," hader ", $string);
$string = str_replace(" øyeblikk "," øjeblik ", $string);
$string = str_replace(" teller "," tæller ", $string);
$string = str_replace(" snakk "," tal ", $string);
$string = str_replace(" mannen "," manden ", $string);
$string = str_replace(" legg "," læg ", $string);
$string = str_replace(" advarte "," advarede ", $string);
$string = str_replace(" drepe "," dræbe ", $string);
$string = str_replace(" vondt "," ondt ", $string);
$string = str_replace(" beslaglegger "," beslaglægger ", $string);
$string = str_replace(" reiser "," rejser ", $string);
$string = str_replace(" situasjonen "," situationen ", $string);
$string = str_replace(" hjelpe "," hjælpe ", $string);
$string = str_replace(" klokka "," klokken ", $string);
$string = str_replace(" glipp "," glip ", $string);
$string = str_replace(" sjansen "," tjansen ", $string);
$string = str_replace(" krypene "," krybene ", $string);
$string = str_replace(" merket "," mærket ", $string);
$string = str_replace(" underutviklete "," underudviklede ", $string);
$string = str_replace(" skapninger "," skabninger ", $string);
$string = str_replace(" kvitt "," kvit ", $string);
$string = str_replace(" ga "," gav ", $string);
$string = str_replace(" heisen "," elevatoren ", $string);
$string = str_replace(" sett "," sæt ", $string);
$string = str_replace(" flyvåpenet "," flyvevåbenet ", $string);
$string = str_replace(" motorikk "," motorik ", $string);
$string = str_replace(" konsentrasjon "," koncentration ", $string);
$string = str_replace(" utholdenhet "," udholdenhed ", $string);
$string = str_replace(" svart "," svaret ", $string);
$string = str_replace(" høyeste "," højeste ", $string);
$string = str_replace(" hva "," hvad ", $string);
$string = str_replace(" vår "," vor ", $string);
$string = str_replace(" oppspilt "," oppustet ", $string);
$string = str_replace(" syns "," synes ", $string);
$string = str_replace(" nølte "," tøvede ", $string);
$string = str_replace(" virket "," virkede ", $string);
$string = str_replace(" gatelykta "," gadelygten ", $string);
$string = str_replace(" trener "," træner ", $string);
$string = str_replace(" skutt "," skudt ", $string);
$string = str_replace(" gymmer "," træner ", $string);
$string = str_replace(" lommetørkle "," lommetørklæde ", $string);
$string = str_replace(" hånda "," hånden ", $string);
$string = str_replace(" hvit "," hvid ", $string);
$string = str_replace(" jente "," pige ", $string);
$string = str_replace(" åtte "," otte ", $string);
$string = str_replace(" bøker "," bøger ", $string);
$string = str_replace(" bøkene "," bøgerne ", $string);
$string = str_replace(" avanserte "," avancerede ", $string);
$string = str_replace(" pønsker "," pønser ", $string);
$string = str_replace(" samvittighet "," samvittighed ", $string);
$string = str_replace(" unnskyldning "," undskyldning ", $string);
$string = str_replace(" skutt "," skudt ", $string);
$string = str_replace(" synsundersøkelse "," synsundersøgelse ", $string);
$string = str_replace(" tenkt "," tænkt ", $string);
$string = str_replace(" oppgave "," opgave ", $string);
$string = str_replace(" unntatt "," undtaget ", $string);
$string = str_replace(" natta "," nat ", $string);
$string = str_replace(" vill "," vild ", $string);
$string = str_replace(" veien "," vej ", $string);
$string = str_replace(" flyktninger "," flygtninge ", $string);
$string = str_replace(" nøytral "," neutral ", $string);
$string = str_replace(" sone "," zone ", $string);
$string = str_replace(" jorda "," jorden ", $string);
$string = str_replace(" verdensutstillingen "," verdensudstillingen ", $string);
$string = str_replace(" fasade "," facade ", $string);
$string = str_replace(" utenomjordiske "," udenjordiske ", $string);
$string = str_replace(" sist "," sidst ", $string);
$string = str_replace(" bestill "," bestil ", $string);
$string = str_replace(" hatt "," haft ", $string);
$string = str_replace(" døra "," døren ", $string);
$string = str_replace(" ålreit "," allright ", $string);
$string = str_replace(" kopp "," kop ", $string);
$string = str_replace(" nei "," nej ", $string);
$string = str_replace(" takk "," tak ", $string);
$string = str_replace(" hei "," hej ", $string);
$string = str_replace(" pulverfløte "," pulverfløde ", $string);
$string = str_replace(" taxisjåfører "," taxichauffører ", $string);
$string = str_replace(" fornøyde "," fornøjede ", $string);
$string = str_replace(" kloke "," kloge ", $string);
$string = str_replace(" takle "," tackle ", $string);
$string = str_replace(" panikk "," panik ", $string);
$string = str_replace(" visste "," vidste ", $string);
$string = str_replace(" sentrum "," centrum ", $string);
$string = str_replace(" flat "," flad ", $string);
$string = str_replace(" forestill "," forestil ", $string);
$string = str_replace(" vite "," vide ", $string);
$string = str_replace(" noensinne "," nogensinde ", $string);
$string = str_replace(" fins "," findes ", $string);
$string = str_replace(" tenk "," tænk ", $string);
$string = str_replace(" verdt "," værd ", $string);
$string = str_replace(" sterk "," stærk ", $string);
$string = str_replace(" annerledes "," anderledes ", $string);
$string = str_replace(" virkelighet "," virkelighed ", $string);
$string = str_replace(" ferdigheter "," færdigheder ", $string);
$string = str_replace(" ferdighetene "," færdighederne ", $string);
$string = str_replace(" dritt "," døjt ", $string);
$string = str_replace(" oppdrag "," opgave ", $string);
$string = str_replace(" lunsj "," frokost ", $string);
$string = str_replace(" frukt "," frugt ", $string);
$string = str_replace(" grønnsaker "," grønsager ", $string);
$string = str_replace(" unna "," fra ", $string);
$string = str_replace(" gretten "," gnotten ", $string);
$string = str_replace(" tollen "," tolden ", $string);
$string = str_replace(" reise "," rejse ", $string);
$string = str_replace(" greier "," ting ", $string);
$string = str_replace(" fettsuging "," fedtsugning ", $string);
$string = str_replace(" kjøpe "," købe ", $string);
$string = str_replace(" universell "," universel ", $string);
$string = str_replace(" oversetter "," oversætter ", $string);
$string = str_replace(" sykdom "," sygdom ", $string);
$string = str_replace(" sant "," sandt ", $string);
$string = str_replace(" hva "," hvad ", $string);
$string = str_replace(" skaff "," skaf ", $string);
$string = str_replace(" greia "," tingest ", $string);
$string = str_replace(" forårsaket "," forsagede ", $string);
$string = str_replace(" strømbruddet "," strømafbrydelsen ", $string);
$string = str_replace(" sjarmøren "," charmør ", $string);
$string = str_replace(" unnskyld "," undskyld ", $string);
$string = str_replace(" uhell "," uheld ", $string);
$string = str_replace(" sant "," sandt ", $string);
$string = str_replace(" je "," jeg ", $string);
$string = str_replace(" dress "," tøj ", $string);
$string = str_replace(" klær "," tøj ", $string);
$string = str_replace(" godkjent "," godkendt ", $string);
$string = str_replace(" kjennetegn "," kendetegn ", $string);
$string = str_replace(" heretter "," herefter ", $string);
$string = str_replace(" skapt "," skabt ", $string);
$string = str_replace(" inntrykk "," indtryk ", $string);
$string = str_replace(" oppleves "," opleves ", $string);
$string = str_replace(" stillhet "," stilhed ", $string);
$string = str_replace(" morsmål "," modersmål ", $string);
$string = str_replace(" bekreftet "," bekræftet ", $string);
$string = str_replace(" greit "," godt ", $string);
$string = str_replace(" rekk "," ræk ", $string);
$string = str_replace(" hendene "," hænderne ", $string);
$string = str_replace(" stoler "," stole ", $string);
$string = str_replace(" pike "," pige ", $string);
$string = str_replace(" pent "," pænt ", $string);
$string = str_replace(" di "," din ", $string);
$string = str_replace(" leid "," lejet ", $string);
$string = str_replace(" spill "," spil ", $string);
$string = str_replace(" bra "," godt ", $string);
//slut ordliste
Avatar billede Slettet bruger
02. maj 2002 - 12:35 #34
Tekst der skal løbes igennem: http://divxit.cliche.dk/MIB.no.txt
Avatar billede Slettet bruger
08. maj 2002 - 09:53 #35
Lukketid tror jeg :)
Avatar billede erikjacobsen Ekspert
09. maj 2002 - 17:55 #36
Har du fjernet MIB.no.txt ?? Vi er da ikke færdige!
Avatar billede Slettet bruger
09. maj 2002 - 18:18 #37
Siden er nede :( Det er Cliche der har klokket i det med nogle IP adresser....
Avatar billede erikjacobsen Ekspert
09. maj 2002 - 18:38 #38
Ok da, jeg har et lille 10 linier (ca) script i Perl, der skal kunne
klare det - hurtigt. Vi får se...
Avatar billede erikjacobsen Ekspert
09. maj 2002 - 23:00 #39
Så har jeg lavet det alligevel. Alle dine ord har jeg puttet på en fil,
ord.txt på formen

trenger,behøver
å,at
inn,ind
bruke,bruge
laget,lavet
knekker,knækker
kodingen,koden
palta,pladen

...+ mange flere linier, og scriptet er dette
  ($a) = @_;
  $b=$a{lc($a)};
  return $b unless $b eq "";
  return $a;.

#!/usr/bin/perl

open(F,"ord.txt");
while ($l=<F>) {
  chomp($l);
  if ($l=~/([^,]+),([^,]+)/) { $a{lc($1)}=lc($2); }
}
close(F);

sub f {
}

$text = join("",<>);
$text=~s/([a-zA-ZæøåÆØÅ]+)/f($1)/ge;
print "$text";



Kører jeg scriptet på en fil på ca 2000 ord, hvor halvdelen ændres, og
resten ikke ændres, så tager det 50 ms på min maskine. Man kan lave
det samme i Perl, men det er trods alt nemmere i Perl.
Avatar billede erikjacobsen Ekspert
09. maj 2002 - 23:01 #40
Vi prøver lige scriptet igen - der gik ged i det:

#!/usr/bin/perl

open(F,"ord.txt");
while ($l=<F>) {
  chomp($l);
  if ($l=~/([^,]+),([^,]+)/) { $a{lc($1)}=lc($2); }
}
close(F);

sub f {
  ($a) = @_;
  $b=$a{lc($a)};
  return $b unless $b eq "";
  return $a;
}

$text = join("",<>);
$text=~s/([a-zA-ZæøåÆØÅ]+)/f($1)/ge;
print "$text";

~
~
~
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Vi tilbyder markedets bedste kurser inden for webudvikling

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester