• R/O
  • SSH
  • HTTPS

autocodeforsql: Commit


Commit MetaInfo

Revision150 (tree)
Time2019-01-21 12:59:05
Authorhilinwei

Log Message

Change Summary

Incremental Difference

--- AutoEpub3/AutoEpub6.Designer.vb (revision 149)
+++ AutoEpub3/AutoEpub6.Designer.vb (revision 150)
@@ -26,6 +26,7 @@
2626 Me.btnNCXDep1 = New System.Windows.Forms.Button()
2727 Me.btnNCXDep3 = New System.Windows.Forms.Button()
2828 Me.Button1 = New System.Windows.Forms.Button()
29+ Me.txtPickUp = New System.Windows.Forms.Button()
2930 Me.SuspendLayout()
3031 '
3132 'btnNCXDep2
@@ -64,11 +65,21 @@
6465 Me.Button1.Text = "NCX Dep 2"
6566 Me.Button1.UseVisualStyleBackColor = True
6667 '
68+ 'txtPickUp
69+ '
70+ Me.txtPickUp.Location = New System.Drawing.Point(407, 26)
71+ Me.txtPickUp.Name = "txtPickUp"
72+ Me.txtPickUp.Size = New System.Drawing.Size(173, 69)
73+ Me.txtPickUp.TabIndex = 13
74+ Me.txtPickUp.Text = "PickUp"
75+ Me.txtPickUp.UseVisualStyleBackColor = True
76+ '
6777 'AutoEpub6
6878 '
6979 Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 12.0!)
7080 Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
7181 Me.ClientSize = New System.Drawing.Size(648, 360)
82+ Me.Controls.Add(Me.txtPickUp)
7283 Me.Controls.Add(Me.Button1)
7384 Me.Controls.Add(Me.btnNCXDep3)
7485 Me.Controls.Add(Me.btnNCXDep1)
@@ -84,4 +95,5 @@
8495 Friend WithEvents btnNCXDep1 As Button
8596 Friend WithEvents btnNCXDep3 As Button
8697 Friend WithEvents Button1 As Button
98+ Friend WithEvents txtPickUp As Button
8799 End Class
--- AutoEpub3/AutoEpub6.vb (revision 149)
+++ AutoEpub3/AutoEpub6.vb (revision 150)
@@ -1,8 +1,10 @@
11 Imports System.IO
2+Imports System.Text.RegularExpressions
23
34 Public Class AutoEpub6
45 Private Sub btnNCXDep1_Click(sender As Object, e As EventArgs) Handles btnNCXDep1.Click
56
7+ Dim listPickString As New List(Of String)
68
79
810 Dim sPath As String = "C:\Users\vmware\Downloads\121432\toc.ncx"
@@ -13,6 +15,8 @@
1315
1416 Dim mEpub As New List(Of modelChapter)
1517
18+
19+
1620 For Each eachPoint As ncxNavPoint In model.navMap
1721
1822 Dim sTitle As String = eachPoint.navLabel.text.Trim()
@@ -28,8 +32,39 @@
2832 mChapter.listText = listTemp
2933 mEpub.Add(mChapter)
3034
35+
36+ For Each sVolumLine As String In listTemp
37+
38+ PickUpString(sVolumLine.Trim(), listPickString)
39+
40+ Next
41+
42+
43+
3144 Next
3245
46+ Dim Cntdd = listPickString.GroupBy(Function(S) S).ToDictionary(Function(a) a.Key, Function(a) a.Count)
47+
48+
49+
50+ Dim sbEee As New System.Text.StringBuilder
51+
52+
53+ For Each kk1 In Cntdd
54+
55+
56+ sbEee.AppendLine(kk1.Key)
57+
58+ Next
59+
60+
61+ Dim k2k1 As String = sbEee.ToString()
62+
63+
64+
65+
66+
67+
3368 Dim cEpub As New cEpub6(emEpub6.emEncCode.SHIFT_JIS, emEpub6.emLan.ZH, "童亮", "鬼称骨", "GCG_201901")
3469 cEpub.bConvertToMobi = False
3570 cEpub.CreateEpub(mEpub)
@@ -445,6 +480,181 @@
445480
446481 End Sub
447482
483+ Private Sub txtPickUp_Click(sender As Object, e As EventArgs) Handles txtPickUp.Click
448484
485+ Dim sTest As String = cTools.sFileReader("C:\Soft\Epub\20190116\OEBPS\test.txt", cEpub6.encUTF8)
449486
487+ Dim listPictUpTemp As New List(Of String)
488+
489+ PickUpString(sTest, listPictUpTemp)
490+
491+
492+ Dim a1 = listPictUpTemp.Count
493+
494+ 'For Each errChar As Char In sPick
495+ ' listPictUpTemp.Add(errChar)
496+ 'Next
497+
498+
499+
500+ 'Dim a1 = listPictUpTemp.Count
501+
502+
503+ End Sub
504+
505+ Private Function listSkipChart() As List(Of String)
506+ listSkipChart = New List(Of String)
507+
508+ listSkipChart.Add(",")
509+ listSkipChart.Add("。")
510+ listSkipChart.Add(":")
511+ listSkipChart.Add("!")
512+ listSkipChart.Add("?")
513+
514+
515+ listSkipChart.Add(Convert.ToChar(8220))
516+ listSkipChart.Add(Convert.ToChar(8221))
517+
518+
519+
520+ End Function
521+
522+
523+ Private Sub PickUpString(ByVal sText As String, ByRef listRep As List(Of String))
524+
525+ Dim sPick As String = Regex.Replace(sText, "[\u4e00-\u9fa5]", "")
526+ If sPick = String.Empty Then
527+ Exit Sub
528+ End If
529+
530+
531+ Dim sTempPick As String = ""
532+
533+ For iCtr As Integer = 0 To sPick.Length - 1
534+ sTempPick += sPick.Substring(iCtr, 1)
535+ If sText.IndexOf(sTempPick) = -1 Then
536+ sTempPick = sTempPick.Substring(0, sTempPick.Length - 1)
537+ Exit For
538+ End If
539+ Next
540+
541+ If sTempPick.Length > 2 Then
542+ listRep.Add(sTempPick)
543+ End If
544+
545+
546+
547+ Dim indexSp1 As Decimal = sText.IndexOf(sTempPick)
548+ sText = sText.Remove(indexSp1, sTempPick.Length)
549+ PickUpString(sText, listRep)
550+
551+ End Sub
552+
553+
554+ 'Private Sub PickUpString(ByVal sText As String, ByRef listRep As List(Of String))
555+
556+ ' 'Dim listSkipChart As List(Of String) = {",", "。", Convert.ToChar(8220), Convert.ToChar(8221), ":", "!", "?", "--", "……"}.ToList
557+ ' Dim listSkipChart As List(Of String) = {"……。"}.ToList
558+
559+ ' If sText.IndexOf("……") > -1 Then
560+ ' Dim kk1 = "1"
561+ ' End If
562+
563+
564+ ' Dim sPick As String = Regex.Replace(sText, "[\u4e00-\u9fa5]", "")
565+
566+ ' If sPick = String.Empty Then
567+ ' Exit Sub
568+ ' End If
569+
570+
571+ ' Dim sTempPick As String = ""
572+
573+ ' Dim bEnd As Boolean = True
574+
575+ ' For iCtr As Integer = 0 To sPick.Length - 1
576+ ' sTempPick += sPick.Substring(iCtr, 1)
577+ ' If sText.IndexOf(sTempPick) = -1 Then
578+ ' sTempPick = sTempPick.Substring(0, sTempPick.Length - 1)
579+
580+ ' Dim sTempPickCopy As String = sTempPick
581+
582+ ' For Each eachSkip As String In listSkipChart
583+
584+ ' If sTempPickCopy.Length > 0 Then
585+ ' If sTempPickCopy.Substring(0, 1) = eachSkip Then
586+ ' Dim indexSp2 As Decimal = sText.IndexOf(sTempPickCopy)
587+
588+ ' If indexSp2 > 0 Then
589+
590+ ' Dim sChkChart As String = sText.Substring(indexSp2 - 1, 1)
591+
592+ ' If Regex.IsMatch(sChkChart, "[\u4e00-\u9fa5]") Then
593+ ' sTempPickCopy = sTempPickCopy.Replace(eachSkip, "")
594+ ' End If
595+
596+ ' End If
597+
598+
599+ ' End If
600+ ' End If
601+
602+
603+ ' Next
604+
605+
606+ ' If sTempPickCopy.Length > 1 Then
607+ ' listRep.Add(sTempPickCopy)
608+ ' End If
609+
610+ ' bEnd = False
611+ ' Exit For
612+ ' End If
613+
614+ ' Next
615+
616+ ' If bEnd Then
617+ ' Dim sTempPickCopy As String = sTempPick
618+
619+
620+ ' For Each eachSkip As String In listSkipChart
621+
622+
623+ ' If sTempPickCopy.Length > 0 Then
624+ ' If sTempPickCopy.Substring(0, 1) = eachSkip Then
625+ ' Dim indexSp2 As Decimal = sText.IndexOf(sTempPickCopy)
626+
627+ ' If indexSp2 <> -1 Then
628+
629+ ' Dim sChkChart As String = sText.Substring(indexSp2 - 1, 1)
630+
631+ ' If Regex.IsMatch(sChkChart, "[\u4e00-\u9fa5]") Then
632+ ' sTempPickCopy = sTempPickCopy.Replace(eachSkip, "")
633+ ' End If
634+
635+ ' End If
636+
637+
638+ ' End If
639+ ' End If
640+
641+
642+ ' Next
643+
644+ ' If sTempPickCopy.Length > 1 Then
645+ ' listRep.Add(sTempPickCopy)
646+ ' End If
647+
648+
649+ ' End If
650+
651+
652+ ' Dim indexSp1 As Decimal = sText.IndexOf(sTempPick)
653+ ' sText = sText.Remove(indexSp1, sTempPick.Length)
654+ ' PickUpString(sText, listRep)
655+
656+ 'End Sub
657+
658+
659+
450660 End Class
\ No newline at end of file
Show on old repository browser