This project is read-only.

NikSharp User Guide

Getting started

Before using NikSharp, please make sure that you have a valid Wordnik API key at hand.

using System;
using NikSharp;

WordnikService service = new WordnikService("Wordnik_API_Key");
var definitions = service.GetDefinitions("word");
foreach (var definition in definitions)
{
    Console.WriteLine("{0} {1}", definition.PartOfSpeech, definition.Text);
}

Asynchronous call

using System;
using NikSharp;

WordnikService service = new WordnikService("Wordnik_API_Key");
var result = service.BeginGetDefinitions("word");

// Do something

var definitions = service.EndGetDefinitions(result);
foreach (var definition in definitions)
{
     Console.WriteLine("{0} {1}", definition.PartOfSpeech, definition.Text);
}

Authenticates a user

using System;
using NikSharp;

WordnikService service = new WordnikService("Wordnik_API_Key");
service.Authenticate("username", "password");
var wordlists = service.GetUserWordList();
foreach (var wordlist in wordlists)
{
    Console.WriteLine("Name: {0}\nWords in list: {1}", wordlist.Name, wordlist.NumberWordsInList);
}

Last edited Apr 1, 2011 at 10:26 AM by Nyyrikki, version 2

Comments

No comments yet.