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; } ?>
|
|---|
Perfect tense - Voltooide tijd
IntroductionThe perfect tense is used to describe events that have taken place in the past. It is used to refer to actions in the past which are still relevant in the present. This is a somewhat vague description but can be illustrated with the following example:
The perfect tense consists of a finite form of an auxiliary verb and a past participle. In the example above, heeft is a finite form of the auxiliary verb hebben and gemaakt is the past participle of the verb maken. Hebben is one of two auxiliary verbs that can be used to form the perfect tense. The other one is zijn. For a reminder of the conjugation of the verbs hebben and zijn: see present tense of irregular verbs. For a detailed description of these auxiliaries, see the relevant section on ‘choice of auxiliary verbs hebben and zijn'. For a description of the formation of the past participle see the relevant section.
Top of page UseThe perfect tense is very common in Dutch. It can often be translated with a perfect tense in English, but English also uses the simple past tense where Dutch uses the perfect tense. A good rule of thumb is that a simple past in Dutch is almost always translated with a simple past in English, but not the other way around. The most important principle is that the perfect tense is used to refer to actions in the past which are still relevant in the present.
In the examples above, the second perfect tense in Dutch is translated with a perfect tense in English, but the first perfect tense in Dutch is translated with a simple past tense in English. Here are some more examples of the use of the perfect tense in context:
Top of page Formation of the past participleFor most verbs, the formation of the past participle follows a regular pattern, but there are a number of irregular verbs that you will need to study. However, most past participles have in common that they begin with the prefix ge:
Top of page Formation of the past participle: regular verbsRegular verbs can be split into two categories: weak verbs and strong verbs. Both these categories of regular verbs follow certain patterns when forming the past participle.
Weak verbs The past participle of weak verbs is formed like this: ge + stem + t or d So, in practice, to form the past participle of the regular verbs wonen (‘to live'), zetten (‘to put'), boeken (‘to book') and landen (‘to land'), you take the following steps:
-d or -t Whether the ending of the past participle is -d or -t depends on the quality of the final sound of the stem. This is a complex concept and therefore it is easiest to remember the following rule:
This rule explains why the past participle of boeken (geboekt) ends in –t: the stem of boeken (boek) ends in –k, which is a consonant from SoFT KeTCHuP. It also explains why the past participle (gewoond) of wonen ends in –d: the stem of wonen (woon) ends in –n which is not a consonant from SoFT KeTCHuP. /z/ ® -s and /v/ ® -f It must be stressed that it is the final letter of the stem before spelling rules are applied, that is important when determining the ending of the past participle. Take for example the verb reizen (‘to travel'). It may look as if the stem would be reis (taking into account the spelling rules for changing a into an at the end of a word). Following the rule given above, you would expect the past participle *gereist. However, it is the <z> of the infinitive that matters here. Therefore:
The same applies to weak verbs where the stem ends in a > before spelling rules are applied:
Strong verbs are also regular, but their regularity works in quite a different way. Strong verbs form their past participle by changing the vowel in the stem of the verb, and having the ending –en (not –d or –t!). Below is an example of what happens to the strong verb blijven when forming the past participle.
This vowel change may seem unpredictable, but there are clear patterns: 1. All verbs with the vowel /ij/ in the stem change to /e/ in the past participle:
2.Most strong verbs with a long /e/ in the stem change to /o/ in the past participle:
3.Some strong verbs with /e/ keep the long vowel /e/ in the past participle:
4.Strong verbs with a short /i/ in the stem change to /o/ in the past participle:
Once you recognise the pattern, you have no need to learn every word individually, but until you do, that is the best strategy. For a basic list of irregular and strong verbs, please refer to the glossary. Top of page Formation of the past participle: irregular verbsThere are also a few verbs for which the formation of the past participle does not follow a regular pattern. These need to be learnt individually. The most commonly used ones are:
For a basic list of irregular and strong verbs, please refer to the glossary Top of page Formation of the past participle: verbs with separable and inseparable prefixes1.verbs with separable prefixes In Dutch, there is a fairly large group of verbs with separable stressed prefixes. In the past participle of a so-called separable verb this separable prefix comes before the prefix ge-:
Below are some examples of this type of verb in context:
2. verbs with unstressed prefixes There are also verbs with unstressed prefixes. These prefixes do not separate and they are limited in number. Past participles of verbs in this category do not receive the extra prefix -ge. The most common unstressed prefixes are:
Below are some examples of this type of verb in context:
Top of page Choices of auxiliary verbs hebben and zijnTwo different auxiliaries are used to form the perfect tense: hebben and zijn.
<
Most verbs take the auxiliary hebben. However, for verbs of motion, it is possible to have either hebben or zijn. This depends on whether the destination of the movement is present or not. If the destination is present, zijn is used. If the destination is absent, hebben must be used. This is illustrated in the example below:
Dont' forget that zijn is used with the verb zijn (past participle geweest) itself:
Top of page Place of past participle in the clauseIn main clauses in the perfect tense, the past participle occurs in the penultimate or final position (see sentence structure). Remember that the finite verb (= the auxiliary verb in the perfect tense) always occurs in second position (in declaratives) or in first position (yes/no questions ).
In a subordinate clause in the perfect tense, both the past participle and the finite verb (i.e. auxiliary) occur in the penultimate or final place together. In the sentences below, the subclause is underlined.
However, there is no preferred order of auxiliary and past participle:
Top of page |