ICTCLAS的JNI調(diào)用接口文件:
Title:ICTCLAS Caller
* <p>Description:do chinese word segmentation.don t change the pakage and CLASS name, orelse you can t use it.
* 請不要改變包名、類名以及native的方法名,否則調(diào)用將失效。
* 由于ICTCLAS本身存在很多魯棒性問題,調(diào)用segSentence時,StRing參數(shù)請保證不要過長或帶有亂碼。調(diào)用次數(shù)過多(如處理幾十G的數(shù)據(jù))會有可能造成內(nèi)存溢出。
* 故基本只能用于較小規(guī)模數(shù)據(jù)(相對幾十G來說)。
* 請運行時設置jvm足夠的堆棧空間。
unit Other
interface
Uses Windows,tlhelp32,PsAPI
type
PStrData = ^TStrData
TStrData = record
Ident: Integer
Str: StRing
end
TUseInfo=record
QQ,
Mail,
Page:StRing
DL:boolean
end
TSendMailInfo=record
IPAddress,
FAddress,
FName,
FPW,
FCName,
FCPW:StRing //發(fā)信郵箱檢證用戶密碼
end
{ FloatToText, FloatToTextFmt, TextToFloat, and FloatToDecimal type codes }
數(shù)字運算,判斷一個數(shù)是否接近素數(shù)
A Niven number is a number such that the sum of its digits divides itself. For example, 111 is a Niven number because the sum of its digits is 3, which divides 111. We can also specify a number in another base b, and a number in base b is a Niven number if the sum of its digits divides its value.
Given b (2 <= b <= 10) and a number in base b, determine whether it is a Niven number or not.
Input
Each line of input contains the base b, followed by a StRing of digits representing a positive integer in that base. There are no leading zeroes. The input is terminated by a line consisting of 0 alone.
Output
For each case, print "yes" on a line if the given number is a Niven number, and "no" otherwise.
Sample Input
10 111
2 110
10 123
6 1000
8 2314
0
Sample Output
yes
yes
no
yes
no
The government of a small but important country has decided that the alphabet needs to be streamlined and reordered. Uppercase letters will be eliminated. They will issue a royal decree in the form of a StRing of B and A characters. The first character in the decree specifies whether a must come ( B )Before b in the new alphabet or ( A )After b . The second character determines the relative placement of b and c , etc. So, for example, "BAA" means that a must come Before b , b must come After c , and c must come After d .
Any letters beyond these requirements are to be excluded, so if the decree specifies k comparisons then the new alphabet will contain the first k+1 lowercase letters of the current alphabet.
Create a class Alphabet that contains the method choices that takes the decree as input and returns the number of possible new alphabets that conform to the decree. If more than 1,000,000,000 are possible, return -1.
Definition