// Path: src/test/java/com/worksap/nlp/sudachi/Utils.java
// public class Utils {
//     public static void copyResource(Path folder, String... files) throws IOException {
//         for (String file : files) {
//             try {
//                 URL src = Utils.class.getResource(file);
//                 Path dest = Paths.get(src.toURI()).getFileName();
//                 Files.copy(src.openStream(), folder.resolve(dest));
//             } catch (URISyntaxException e) {
//                 throw new IOException(e);
//             }
//         }
//     }
// }


import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import static org.hamcrest.core.StringStartsWith.startsWith;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.PrintStream;
import com.worksap.nlp.sudachi.TestDictionary;
import com.worksap.nlp.sudachi.Utils;
import org.junit.Before;
import org.junit.Rule;
/*
 * Copyright (c) 2017-2022 Works Applications Co., Ltd.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.worksap.nlp.sudachi.dictionary;





public class DictionaryHeaderPrinterTest {

    @Rule
    public TemporaryFolder temporaryFolder = new TemporaryFolder();

    @Before
    public void setUp() throws IOException {
        TestDictionary.INSTANCE.getSystemDictData().writeData(temporaryFolder.getRoot().toPath().resolve("system.dic"));
        TestDictionary.INSTANCE.getUserDict1Data().writeData(temporaryFolder.getRoot().toPath().resolve("user.dic"));
// Path: src/test/java/com/worksap/nlp/sudachi/Utils.java
// public class Utils {
//     public static void copyResource(Path folder, String... files) throws IOException {
//         for (String file : files) {
//             try {
//                 URL src = Utils.class.getResource(file);
//                 Path dest = Paths.get(src.toURI()).getFileName();
//                 Files.copy(src.openStream(), folder.resolve(dest));
//             } catch (URISyntaxException e) {
//                 throw new IOException(e);
//             }
//         }
//     }
// }


// Path: src/test/java/com/worksap/nlp/sudachi/dictionary/DictionaryHeaderPrinterTest.java
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import static org.hamcrest.core.StringStartsWith.startsWith;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.PrintStream;
import com.worksap.nlp.sudachi.TestDictionary;
import com.worksap.nlp.sudachi.Utils;
import org.junit.Before;
import org.junit.Rule;

/*
 * Copyright (c) 2017-2022 Works Applications Co., Ltd.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.worksap.nlp.sudachi.dictionary;





public class DictionaryHeaderPrinterTest {

    @Rule
    public TemporaryFolder temporaryFolder = new TemporaryFolder();

    @Before
    public void setUp() throws IOException {
        TestDictionary.INSTANCE.getSystemDictData().writeData(temporaryFolder.getRoot().toPath().resolve("system.dic"));
        TestDictionary.INSTANCE.getUserDict1Data().writeData(temporaryFolder.getRoot().toPath().resolve("user.dic"));
        Utils.copyResource(temporaryFolder.getRoot().toPath(), "/unk.def");