Skip to content

Commit

Permalink
Cleaning up bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
hopto-dot committed Sep 10, 2020
1 parent 1ac79bb commit b674226
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions Japanese Conjugation Helper/Module1.vb
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,10 @@ Module Module1
HTML = Client.DownloadString(New Uri(WordURL))
Dim AddingTemp As String

If HTML.IndexOf("No matches for") <> -1 Then
Console.WriteLine("Looking for similar words...")
End If

If HTML.IndexOf("zen_bar") <> -1 And Anki = False Then
TranslateSentence(Word)
End If
Expand Down Expand Up @@ -434,6 +438,7 @@ Module Module1
Dim WordChoice As Integer = 10000
Dim ActualSearch2ndAppearance As String
Dim Definition1 As String = ""

If WordIndex <> 1 Then 'scraping of words and definitions -------------------------------------------------------------------------------------------
For LoopIndex = 0 To Max - 1
Array.Resize(FoundWords, FoundWords.Length + 1)
Expand Down Expand Up @@ -495,6 +500,7 @@ Module Module1


Next 'end of multiple word scrapping ___________________________________________________________________________
Console.WriteLine("Finalizing...")
Array.Resize(FoundDefinitions, FoundDefinitions.Length - 1)
Array.Resize(FoundWords, FoundDefinitions.Length)
Array.Resize(FoundWordLinks, FoundDefinitions.Length)
Expand Down Expand Up @@ -525,7 +531,7 @@ Module Module1
Console.Clear()
Console.WriteLine("Which definition would you like details for? Type a number, 0 to cancel.")
Console.WriteLine()
Console.WriteLine()

Dim TotalWordsFound As Integer = 0
For looper = 1 To FoundWords.Length
If IsNothing(FoundWords(looper - 1)) = False Then
Expand Down Expand Up @@ -611,7 +617,7 @@ Module Module1
Max = 0 'because we are in the "else" part of the if statement which means that the user inputted no number or 1
WordChoice = 0
End If 'end of one word scrapping and all scrapping _______________________________________________________________________________________________________________________

Console.WriteLine("Building information...")
If WordChoice = 0 Then
WordChoice = 1
End If
Expand All @@ -623,8 +629,6 @@ Module Module1
SelectedDefinition(Add - 1) = SelectedDefinition(Add - 1).Replace("&quot;", QUOTE) & Add
Next



Dim StartingHTML As Integer
StartingHTML = HTML.IndexOf(ActualSearchWord)
HTMLTemp = Mid(HTML, StartingHTML)
Expand All @@ -638,7 +642,7 @@ Module Module1
End If
Dim FullWordType As String = TypeSnip
Dim TypeSnipEnd As Integer = TypeSnip.IndexOf(",") 'This is to check if there is more than one word type
Console.Clear()




Expand Down Expand Up @@ -741,6 +745,8 @@ Module Module1
End If
NumberCheckT = NumberCheckT.Replace(" ", "")

Console.Clear()

If NumberCheckT = NumberCheckD Then
If Definition < DefG1 + 1 Then
If Definition <> 0 Then
Expand Down Expand Up @@ -1354,7 +1360,6 @@ Module Module1
Console.WriteLine("Copied " & QUOTE & KanjisLine & QUOTE & " to clipboard")
Console.ReadLine()


ElseIf LastRequest.ToLower = "anki" Or LastRequest.ToLower = "copy anki" Or Anki = True Then
If FoundTypes.IndexOf("!") = FoundTypes.Length Then
FoundTypes = Left(FoundTypes, FoundTypes.Length - 1)
Expand Down Expand Up @@ -1401,12 +1406,8 @@ Module Module1

If NumberCheckT = NumberCheckD Then

If Definition <> 0 Then
AnkiCopy = vbCrLf & AnkiCopy
End If

If Definition < 10 Then
AnkiCopy = AnkiCopy & (Left(AnkiString(Type), AnkiString(Type).Length - NumberCheckT.Length)) & vbCrLf
AnkiCopy = AnkiCopy & (Left(AnkiString(Type), AnkiString(Type).Length - NumberCheckT.Length))
ElseIf Definition > 9 And AnkiString(Type).IndexOf("aux") <> -1 Or Definition > 9 And AnkiString(Type).IndexOf("irr") Then
AnkiCopy = AnkiCopy & vbCrLf & (Left(AnkiString(Type), AnkiString(Type).Length - NumberCheckT.Length))

Expand All @@ -1421,9 +1422,9 @@ Module Module1

AnkiCopy = AnkiCopy & vbCrLf

AnkiCopy = vbCrLf & AnkiCopy & Definition + 1 & ". " & Left(SelectedDefinition(Definition), SelectedDefinition(Definition).Length - NumberCheckD.Length).Replace(BArea, "") & BArea
AnkiCopy = AnkiCopy & Definition + 1 & ". " & Left(SelectedDefinition(Definition), SelectedDefinition(Definition).Length - NumberCheckD.Length).Replace(BArea, "") & BArea
Else
AnkiCopy = vbCrLf & AnkiCopy & Definition + 1 & ". " & Left(SelectedDefinition(Definition), SelectedDefinition(Definition).Length - NumberCheckD.Length).Replace(BArea, "")
AnkiCopy = AnkiCopy & vbCrLf & Definition + 1 & ". " & Left(SelectedDefinition(Definition), SelectedDefinition(Definition).Length - NumberCheckD.Length).Replace(BArea, "")
End If

End If
Expand All @@ -1448,7 +1449,7 @@ Module Module1

If BArea.IndexOf("kana") = -1 Then
If Definition <> 0 Then
AnkiCopy = AnkiCopy & vbCrLf
'AnkiCopy = AnkiCopy & vbCrLf
End If
AnkiCopy = AnkiCopy & vbCrLf & Definition + 1 & ". " & Left(SelectedDefinition(Definition), SelectedDefinition(Definition).Length - NumberCheckD.Length).Replace(BArea, "") & BArea
Else
Expand Down

0 comments on commit b674226

Please sign in to comment.