define('PREG_FIND_RECURSIVE', 1); define('PREG_FIND_DIRMATCH', 2); define('PREG_FIND_FULLPATH', 4); define('PREG_FIND_NEGATE', 8); define('PREG_FIND_DIRONLY', 16); define('PREG_FIND_RETURNASSOC', 32); define('PREG_FIND_SORTDESC', 64); define('PREG_FIND_SORTKEYS', 128); define('PREG_FIND_SORTBASENAME', 256); # requires PREG_FIND_RETURNASSOC define('PREG_FIND_SORTMODIFIED', 512); # requires PREG_FIND_RETURNASSOC define('PREG_FIND_SORTFILESIZE', 1024); # requires PREG_FIND_RETURNASSOC define('PREG_FIND_SORTDISKUSAGE', 2048); # requires PREG_FIND_RETURNASSOC // PREG_FIND_RECURSIVE - go into subdirectorys looking for more files // PREG_FIND_DIRMATCH - return directorys that match the pattern also // PREG_FIND_DIRONLY - return only directorys that match the pattern (no files) // PREG_FIND_FULLPATH - search for the pattern in the full path (dir+file) // PREG_FIND_NEGATE - return files that don't match the pattern // PREG_FIND_RETURNASSOC - Instead of just returning a plain array of matches, // return an associative array with file stats // // You can also request to have the results sorted based on various criteria // By default if any sorting is done, it will be sorted in ascending order. // You can reverse this via use of: // PREG_FIND_SORTDESC - Reverse order of sort // PREG_FILE_SORTKEYS - Sort on the keyvalues or non-assoc array results // The following sorts *require* PREG_FIND_RETURNASSOC to be used as they are // sorting on values stored in the constructed associative array // PREG_FIND_SORTBASENAME - Sort the results in alphabetical order on filename // PREG_FIND_SORTMODIFIED - Sort the results in last modified timestamp order // PREG_FIND_SORTFILESIZE - Sort the results based on filesize // PREG_FILE_SORTDISKUSAGE - Sort based on the amount of disk space taken // to use more than one simply seperate them with a | character // Search for files matching $pattern in $start_dir. // if args contains PREG_FIND_RECURSIVE then do a recursive search // return value is an associative array, the key of which is the path/file // and the value is the stat of the file. Function preg_find($pattern, $start_dir='.', $args=NULL) { static $depth = -1; ++$depth; $files_matched = array(); $fh = opendir($start_dir); while (($file = readdir($fh)) !== false) { if (strcmp($file, '.')==0 || strcmp($file, '..')==0) continue; $filepath = $start_dir . '/' . $file; if (preg_match($pattern, ($args & PREG_FIND_FULLPATH) ? $filepath : $file)) { $doadd = is_file($filepath) || (is_dir($filepath) && ($args & PREG_FIND_DIRMATCH)) || (is_dir($filepath) && ($args & PREG_FIND_DIRONLY)); if ($args & PREG_FIND_DIRONLY && $doadd && !is_dir($filepath)) $doadd = false; if ($args & PREG_FIND_NEGATE) $doadd = !$doadd; if ($doadd) { if ($args & PREG_FIND_RETURNASSOC) { // return more than just the filenames $fileres = array(); if (function_exists('stat')) { $fileres['stat'] = stat($filepath); $fileres['du'] = $fileres['stat']['blocks'] * 512; } if (function_exists('fileowner')) $fileres['uid'] = fileowner($filepath); if (function_exists('filegroup')) $fileres['gid'] = filegroup($filepath); if (function_exists('filetype')) $fileres['filetype'] = filetype($filepath); if (function_exists('mime_content_type')) $fileres['mimetype'] = mime_content_type($filepath); if (function_exists('dirname')) $fileres['dirname'] = dirname($filepath); if (function_exists('basename')) $fileres['basename'] = basename($filepath); if (isset($fileres['uid']) && function_exists('posix_getpwuid')) $fileres['owner'] = posix_getpwuid ($fileres['uid']); $files_matched[$filepath] = $fileres; } else array_push($files_matched, $filepath); } } if ( is_dir($filepath) && ($args & PREG_FIND_RECURSIVE) ) { $files_matched = array_merge($files_matched, preg_find($pattern, $filepath, $args)); } } closedir($fh); // Before returning check if we need to sort the results. if (($depth==0) && ($args & (PREG_FIND_SORTKEYS|PREG_FIND_SORTBASENAME|PREG_FIND_SORTMODIFIED|PREG_FIND_SORTFILESIZE|PREG_FIND_SORTDISKUSAGE)) ) { $order = ($args & PREG_FIND_SORTDESC) ? 1 : -1; $sortby = ''; if ($args & PREG_FIND_RETURNASSOC) { if ($args & PREG_FIND_SORTMODIFIED) $sortby = "['stat']['mtime']"; if ($args & PREG_FIND_SORTBASENAME) $sortby = "['basename']"; if ($args & PREG_FIND_SORTFILESIZE) $sortby = "['stat']['size']"; if ($args & PREG_FIND_SORTDISKUSAGE) $sortby = "['du']"; } $filesort = create_function('$a,$b', "\$a1=\$a$sortby;\$b1=\$b$sortby; if (\$a1==\$b1) return 0; else return (\$a1<\$b1) ? $order : 0- $order;"); uasort($files_matched, $filesort); } --$depth; return $files_matched; } ?>
|
|---|
Spelling and pronunciation - Spelling en uitspraakIntroductionDutch spelling is much more systematic than, for instance, English spelling. There are some rules to learn, but once you know them they are easy to apply. The pronunciation of Dutch may occasionally appear difficult, especially with certain vowel sounds, but as with spelling, the rules for pronunciation are quite systematic.
Spelling and pronunciation go hand in hand, and in the explanation below the two are generally discussed together. In the following explanation sounds are put in between //. This is a linguistic convention. Letters are put between <>. Words that are grammatically incorrect are preceded by *. Top of pageThe alphabetThe Dutch alphabet has 26 letters, which are divided into vowels (klinkers) and consonants (medeklinkers). You can listen to the way they sound here.
VOWELSThese are the Dutch vowels:
The vowels <a>,< e>,< i>,< o> and >in the above examples are all pronounced as short vowel sounds. These vowels can also be pronounced as long sounds, in which case certain spelling rules apply (spelling of long vowel sounds) The letter can be pronounced as the short vowel /e/ as in bel, the long vowel /e./ as the first in leren, but also as the unstressed /¶/,,which is called a 'schwa'. The schwa can be heard for example in the suffix -en to make the plural of verbs and nouns; e.g. bellen /bel¶n/, leren /le.r¶n/, tassen /tas¶n/. All of the above vowels can occur together with another vowel: ,>, , , , and >. The combinations , and are pronounced as a singular sound:
In the pronunciation of the other combinations of vowels, however, the two different vowels can be identified. These are called diphthongs. The letter combinations > and > represent the same sound (i.e. > and > sound the same), as do <ei> and <ij> (i.e. <ei> and <ij> sound the same).
CONSONANTSThe Dutch consonants are:
Some consonants can be combined with other consonants to produce different sounds: The consonants <c> and <h > are combined to form <ch> which is generally pronounced as /g/, but in some loan words, like chocola, the <ch> is pronounced as /sj/. The letter <c> can be pronounced as either /s/ (ICIR) or /k/ (cadeau). The letters <d> and <b>, when occurring at the end of a word, are in fact pronounced as /t/ and /p/ respectively. The <d> in the word goed ('good'), for instance, is pronounced as /t/, and the <b> in heb ('have') is pronounced as /p/. Consonants are doubled to allow for the spelling of short vowel sounds. One thing to remember is that Dutch words can never end in a double consonant. A word like *basketball would not be correct in Dutch, it should be basketbal. EXCEPTIONSSome loan words in Dutch have pronunciations that do not follow the above guidelines. Words like computer (from the English) and journalist (from the French) retain most of their original pronunciation. Others are partly adapted to Dutch pronunciation, for instance the word garage. The pronunciations of these words are best memorized as you come across them. Top of page Spelling of long vowel soundsIf a long vowel is followed by one or more consonants in the same syllable, it is written double. E.g. naam ('name'), in which the letters stand for the long vowel /a./. Other examples:
The long vowel /i./ is given an additional :
If these vowel sounds occur as the long vowel in the configuration long vowel-single consonant-any vowel (long V-C-V) in the same word (e.g. in the plural of nouns or verbs), they are written as a single letter:
As a general rule you can say that the following sequence is NOT allowed in Dutch spelling: *V-V-C-V The plural of the word buur could, following this rule, never be *buuren. The only exception to this rule is the word tweede ('second'). The letter is the only long vowel that can appear as a double identical letter at the end of a word:
Top of page Spelling of short vowel soundsShort vowels are always written as a single letter. When the short vowel is followed by consonants and another vowel, the spelling rule that applies is:
short vowel – consonant – consonant – vowel (short V-C-C-V). When forming the plural of nouns with –en, or in the conjugation of verbs, or in the formation of comparatives, consonants will need to be doubled after short vowels. Some examples are:
It follows that if the short vowel in a word is already followed by two or more consonants, no doubling of the last consonant is required, because the criterion ‘short V–C–C–V' has been met. E.g.: krant ® kranten, not * krantten newspaper - newspapers Top of page F/v and s/zConsider the following:
The above examples show that the letters / and / form a special case in Dutch spelling. These letters may trigger some changes in the spelling because of the following rules:
- In spelling, you write what you hear with these sounds (unlike /b/-/p/ and /d/-/t/, see consonants); Therefore, in Dutch, the letter <v> can be changed into <f> and the letter <z> can be changed into <s> and vice versa. This happens, for example, when conjugating verbs or when forming the plural of nouns, or when forming comparatives. For example, the verb leven ('to live') in its infinitive form is spelled with a <v> in the middle. The stem of that verb, however, cannot end in <v> (*leev is not correct) and the <v> is therefore changed into an <f>. A similar thing happens when forming the plural of nouns. The noun huis ('house'), cannot have the plural form *huisen because the <s> can only occur at the end of a word or before a consonant. Some other examples are:
Top of page Accent marksAs in many other languages, Dutch vowels (though not consonants) sometimes receive accent marks. Apart from the imported <ê>, these accent marks do not 'create' new vowel sounds but they merely help the reader interpret some of the vowels.
é, á, ó, ú
ë, ï, ö, ü The two 'dots' on a vowel are called a diaresis (trema in Dutch). You'll see it most frequently on the letter <e>. It basically tells the reader that the vowel with the diaresis has to be pronounced separately. It occurs in various situations. Some common ones are:
è This accent mark is placed on short vowel sounds, mainly on <e>: Hè, moet ik echt naar binnen? ('Ahh, do I really have to come inside?'). ê You'll only find this accent mark in loan words like enquête ('questionnaire'). Top of page |