function [PCKSAAP,NCKSAAP]=CKSAAPgenerate(positive,negative,topfeature,window)
n=size(positive,1);
m=size(positive,2);
PCKSAAP=zeros(n,length(topfeature));
for i=1:n
    center=(m-1)/2+1;
    schar=positive(i,(center-window):(center+window));
    D=length(schar);
    for j=1:length(topfeature)
        temp=topfeature(j,:);
        mmm=str2num(temp(3));
        for k=1:(D-mmm-1)
           if schar(1,k)==temp(1)&&schar(1,k+mmm+1)==temp(2)
               PCKSAAP(i,j)=PCKSAAP(i,j)+1;
           end
        end
    end
end
n=size(negative,1);
m=size(negative,2);
NCKSAAP=zeros(n,length(topfeature));
for i=1:n
    center=(m-1)/2+1;
    schar=negative(i,(center-window):(center+window));
    D=length(schar);
    for j=1:length(topfeature)
        temp=topfeature(j,:);
        mmm=str2num(temp(3));
        for k=1:(D-mmm-1)
           if schar(1,k)==temp(1)&&schar(1,k+mmm+1)==temp(2)
               NCKSAAP(i,j)=NCKSAAP(i,j)+1;
           end
        end
    end
end