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; } ?>
|
|---|
ExercisesEach topic in the Subject index is accompanied by interactive, self-correcting exercises. To view the exercises for a specific grammar topic, enter the Subject index and click on the appropriate link in the left banner. The exercises open in a separate, resizable window. Further down this page, you find a list of all exercises in the Advanced Dutch Grammar.
The exercises were developed with Hot Potatoes educational software. They include multiple-choice, short-answer, matching/ordering and gap-fill exercises. They are all self-explanatory and self-correcting, providing model answers and feedback. We advise you to read the instructions for each exercise very carefully. Automatic scoring is included for each exercise. Note that an exercise will only submit a result if it is properly completed: exercises are considered completed when all the questions have been answered correctly. Most exercises can be completed multiple times: reload the exercise/page for more and new questions and tasks. Practical tip before you start: click here to find out how to install a Dutch keyboard. Parts of speechGENERAL REVISION EXERCISES Exercise 1 (short answer exercise about word classes or parts of speech). Exercise 2 (short answer exercise about word classes or parts of speech). Exercise 3 (matching exercise about word classes or parts of speech). Exercise 4 (matching exercise about word classes or parts of speech). Exercise 5 (matching exercise about word classes or parts of speech). Exercise 6 (gap fill exercise about word classes or parts of speech). Exercise 7 (gap fill exercise about word classes or parts of speech). Exercise 8 (gap fill exercise about word classes or parts of speech). REVISION EXERCISES ON SPECIFIC TOPICS Exercise 1 (gap fill exercise about adjectives). Exercise 2 (gap fill exercise about adjectives and adverbs). Exercise 3 (short answer exercise about pronouns). Exercise 4 (short answer exercise about verbs). Exercise 5 (matching exercise about verbs). Exercise 6 (gap fill exercise about verbs). ConstituentsGENERAL REVISION EXERCISES Exercise 1 (short answer exercise about constituents). Exercise 2 (short answer exercise about constituents). Exercise 3 (matching exercise about constituents). Exercise 4 (matching exercise about constituents). Exercise 5 (matching exercise about constituents). Exercise 6 (matching exercise about constituents). REVISION EXERCISES ON SPECIFIC TOPICS Exercise 1 (short answer exercise about subjects). Exercise 2 (short answer exercise about objects). Exercise 3 (multiple choice exercise about finite verbs) Exercise 4 (short answer exercise about verbal predicates). Exercise 5 (short answer exercise about nominal predicates). Sentence typesGENERAL EXERCISES Exercise 1 (short answer exercise about sentence types). Exercise 2 (matching exercise about sentence types). Exercise 3 (matching exercise about sentence types). EXERCISES ON SPECIFIC TOPICS Exercise 1 (short answer exercise about indirect speech). Exercise 2 (short answer exercise about indirect speech). Exercise 3 (short answer exercise about questions). Exercise 4 (short answer exercise about passive). Exercise 5 (short answer exercise about passive). Exercise 6 (short answer exercise about passive). Exercise 7 (short answer exercise about passive). Referring expressionsGENERAL EXERCISES
Exercise 1 (gap fill exercise about referring expressions). Exercise 2 (gap fill exercise about referring expressions). EXERCISES ON SPECIFIC TOPICS Exercise 1 (gap fill exercise about pronouns). Exercise 2 (short answer exercise about pronouns). Exercise 3 (gap fill exercise about pronominal adverbs). Exercise 4 (short answer exercise about pronominal adverbs) ConnectivesExercise 1 (short answer exercise about coordinating or subordinating conjunctions). Exercise 2 (gap fill exercise about coordinating and subordinating conjunctions and conjunctional adverbs). Exercise 3 (gap fill exercise about coordinating and subordinating conjunctions and conjunctional adverbs). Exercise 4 (short answer exercise about coordinating and subordinating conjunctions and conjunctional adverbs). Exercise 5 (gap fill exercise about coordinating and subordinating conjunctions and conjunctional adverbs). CohesionLEXICAL VARIATION Exercise 1 (short answer exercise about lexical variation). Exercise 2 (short answer exercise about lexical variation). Exercise 3 (short answer exercise about lexical variation). Exercise 4 (short answer exercise about lexical variation). STYLE Exercise 1 (multiple choice exercise about style). Exercise 2 (multiple choice exercise about style). Exercise 3 (multiple choice exercise about style). Sentence structureGeneral exercises Exercise 1 (short answer exercise about word order). Exercise 2 (short answer exercise about word order). Exercises on specific topics Exercise 1 (short answer exercise about main clauses). Exercise 2 (short answer exercise about subclauses). Exercise 3 (short answer exercise about subclauses). Exercise 4 (short answer exercise about subclauses). Exercise 5 (short answer exercise about elliptical clauses). Exercise 6 (short answer exercise about subject clauses). PolitenessEXERCISES ON SPECIFIC TOPICS Exercise 1 (short answer exercise about forms of address). Exercise 2 (short answer exercise about forms of address). Exercise 3 (short answer exercise about modal particles). Exercise 4 (short answer exercise about modal particles). Exercise 5 (short answer exercise about the use of zou).
|