写一个程序，从给定的文字数据中找到最常见的5个单词，并统计它们出现的次数。
```
"This is a test string. This string is used to test the program to find the top 5 most frequent words in the string."
```
以下是 Python 代码，可以计算出给定字符串中出现最频繁的5个单词以及它们出现的次数。

```python
sentence = "This is a test string. This string is used to test the program to find the top 5 most frequent words in the string."

# 将单词转换成小写，并将标点符号去除
words = sentence.lower().replace('.', '').replace(',', '').split()

# 用字典统计每个单词的出现次数
word_count = {}
for word in words:
    if word in word_count:
        word_count[word] += 1
    else:
        word_count[word] = 1

# 找出出现最频繁的5个单词并输出它们的出现次数
sorted_word_count = sorted(word_count.items(), key=lambda x: x[1], reverse=True)
for i in range(5):
    print(sorted_word_count[i][0], sorted_word_count[i][1])
```

输出：

```
the 4
string 2
is 2
test 2
this 2
```