Coder Social home page Coder Social logo

yahooapis-cpp's Introduction

yahooapis-cpp

MIT License
C/C++ Yahoo API Wrapper

##Usage

###Yahoo形態素解析

#include "yapis_cpp.hpp"

int main() {
    YAPIsCpp yapis = YAPIsCpp("<Your APP ID>");
    YAPIsCpp::MAResult res = yapis.ma_post("庭には二羽鶏がいる");
    std::cout << res.total_count << std::endl;
    std::cout << res.filtered_count << std::endl;
    for (std::string s : res.word_list) {
        std::cout << s << std::endl;
        std::cout << res.reading[s] << std::endl;
        std::cout << res.pos[s] << std::endl;
        std::cout << res.baseform[s] << std::endl;
        std::cout << res.feature[s] << std::endl;
    }
    return 0;
}

###Yahooかな漢字変換

#include "yapis_cpp.hpp"

int main() {
    YAPIsCpp yapis = YAPIsCpp("<Your APP ID>");
    YAPIsCpp::JIMResult res = yapis.jim_post("おなかがすいた");
    for (auto s : res.segment_list) {
        std::cout << s << std::endl;

        for (auto el : res.candidate_list[s]) {
            std::cout << el <<std::endl;
        }
    }
}

###ルビ振り

#include "yapis_cpp.hpp"

int main() {
    YAPIsCpp yapis = YAPIsCpp("<Your APP ID>");
    YAPIsCpp::FuriganaResult res = yapis.furigana_post("今日は日曜日");
        for (auto s : res.word_list) {
             std::cout << s << std::endl;
             std::cout << res.furigana_list[s] << std::endl;
             std::cout << res.roman_list[s] << std::endl;
        }
    }
}

###校正支援

#include "yapis_cpp.hpp"

int main() {
    YAPIsCpp::KouseiResult res = yapis.kousei_post("遙か彼方に小形飛行機が見える");
    for (auto s : res.start_pos) {
        std::cout << s << std::endl;
        std::cout << res.length[s] << std::endl;
        std::cout << res.surface[s] << std::endl;
        std::cout << res.shiteki_word[s] << std::endl;
        std::cout << res.shiteki_info[s] << std::endl;
    }
    return 0;
}

yahooapis-cpp's People

Contributors

nocotan avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

howmedo

yahooapis-cpp's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.