Пользуйся:
-
- Dim I, J, K, M, Pg, Ns, Ks, re
- Dim text As String
- Dim MasT() As String
- Dim MasS() As String
- Dim SL
- Dim G As String
- Dim GL()
- Dim SLOG As String
- Список1.Clear
-
- text = Текст1.text
- G = "`1234567890-=[]\';/.,~!@#$%^&*()_+{}|?><-;:«»"
- For I = 1 To 45
- text = Replace(text, Mid(G, I, 1), " ")
- text = Replace(text, " ", " ")
- Next I
- G = "ауоыиэяюёе"
- MasT = Split(text, vbNewLine)
- For I = 0 To UBound(MasT)
- MasS = Split(MasT(I), " ")
- For J = 0 To UBound(MasS)
- Erase GL
- SLOG = ""
- ReDim GL(0)
- For K = 1 To Len(MasS(J))
- If InStr(1, G, Mid(MasS(J), K, 1)) > 0 Then
- ReDim Preserve GL(UBound(GL) + 1)
- GL(UBound(GL)) = K
- End If
- Next K
- Ns = 1
- If UBound(GL) > 0 Then
- For M = 1 To UBound(GL) - 1
-
- Select Case (GL(M + 1) - GL(M))
- Case 1
- Ks = Ns + 1
- Case 2
- Ks = GL(M)
- Case 3, 4, 5
-
- Ks = IIf((Mid(MasS(J), GL(M) + 2, 1) = "ь" Or Mid(MasS(J), GL(M) + 2, 1) = "ъ"), GL(M) + 2, GL(M) + 1)
- End Select
- SLOG = Mid(MasS(J), Ns, Ks - Ns + 1)
- Список1.AddItem SLOG
-
- Ns = Ks + 1
- Next M
- SLOG = Mid(MasS(J), Ns, Len(MasS(J)) - Ns + 1)
- Список1.AddItem SLOG
- End If
- Next J
- Next I
Ответить
|