 
 class PDFmethod2 {
     
+    let tolerance = 3.0                         //同じ行と判定させるための許容誤差
+    
     /****************************実行用のメソッド******************************/
     func RunPDFmethod() {
         let charinfoArray = GetPDFGlyphInfo()
         var sorted = SortcharinfoArray(charinfoArray)
         
+        //各配列のY座標の平均値を求める
+        var YaverageArray: [Double] = []
+        for i in 0..<sorted.count {
+            YaverageArray.append(Get_Y_Average(sorted[i]))
+        }
+        
+        let unioned = UnionArrayByY(YaverageArray, charinfo: sorted)
         
         
-        for i in 0..<sorted.count {
-            let ABC = sorted[i][0]
-            print(String(ABC.y) + ": ", terminator: "")
-            for j in 0..<sorted[i].count {
-                let hoge = sorted[i][j]
-                print(String(hoge.text), terminator: "")
-            }
-            print("****************")
-        }
+        //        for i in 0..<sorted.count {
+        //            let ABC = sorted[i][0]
+        //            print(String(ABC.y) + ": ", terminator: "")
+        //            for j in 0..<sorted[i].count {
+        //                let hoge = sorted[i][j]
+        //                print(String(hoge.text), terminator: "")
+        //            }
+        //            print("****************")
+        //        }
         
     }
-
+    
     
     /****************************pdfのテキスト情報を2次元配列に行ごとに格納する******************************/
-    
-    let tolerance = 3.0                         //同じ行と判定させるための許容誤差
-
     func GetPDFGlyphInfo() -> [[CharInfo]] {
         var charinfoArray: [[CharInfo]] = []
         var prev_y = -99.99
         var currentArrayIndex = -1
-
+        
         let path: NSString
         //path = DBmethod().FilePathTmpGet()
         path = NSBundle.mainBundle().pathForResource("8.11〜", ofType: "pdf")!

        
        return sorted
    }

}

                }
                
                charinfoArray[currentArrayIndex].append(charinfo)
                
            }
            text = tet.get_text(page)
        }
