Implement a function dup_ngram_ratio(text, n) that computes the duplicated n-gram coverage ratio of a text string. Tokenize the text by whitespace splitting. Form all contiguous n-grams (as tuples of consecutive tokens). The duplicated n-gram coverage ratio is the fraction of n-gram occurrences (counting positions, not unique types) whose n-gram appears more than once in the document.
If the text has fewer than n tokens (so zero n-grams can be formed), return 0.0. Round the final result to 4 decimal places.