小编rav*_*n99的帖子

WordNet与ElasticSearch集成 - 如何添加新的同义词

我使用ElasticSearch版本1.2.3

我已将WordNet 3.0集成为ElasticSearch Synonyms Analyzer的同义词数据库.(完整的WordNet安装:configure,make,make install)

我已将以下代码添加到ElasticSearch索引设置中(索引名称为local_es)

curl -XPUT 'localhost:9200/local_es/_settings' -d '{
"settings" : {
"analysis" : {
  "analyzer" : {
    "synonym" : {
    "tokenizer" : "lowercase",
    "filter" : ["synonym"]
    }
   },
   "filter" : {
   "synonym" : {
   "type" : "synonym",
   "format": "wordnet",
   "synonyms_path": "analysis/wn_s.pl"
   }
  }
 }
}
}'
Run Code Online (Sandbox Code Playgroud)

我还用以下代码更新了映射:

enter code here
curl -XPUT 'localhost:9200/local_es/shadowpage/_mapping' -d '{
"shadowpage" : {
"shadowPageName" : {
  "enabled" : true,
  "analyzer" : "synonym"
},
"properties" : …
Run Code Online (Sandbox Code Playgroud)

synonym wordnet elasticsearch

7
推荐指数
1
解决办法
2244
查看次数

虽然图像远程存在于服务器上,但SDWebImage不显示图像

我正在开发一个iOS应用程序,我正在使用SDWebImage作为图像下载程序API.

我正在使用UICollectionView,我在方法中使用它

- (UICollectionViewCell *)collectionView:(SMToplinksCollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath

有些图像是下载的,有些则不是.未下载的那些显示错误消息:

2014-06-15 12:11:50.203 c_shadow_ios_iphone [6867:60b] ===错误:错误域= NSURLErrorDomain代码= -1100"操作无法完成.(NSURLErrorDomain错误-1100.)"

错误-1100:NSURLErrorFileDoesNotExist

此外,UIImage似乎是零.

我已经检查了SDWebImage尝试下载的URL,它正确地获取了图像,因此Error似乎不合理

这是我使用的方法代码:

- (UICollectionViewCell *)collectionView:(SMToplinksCollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{    
SMToplinkCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:TopLinksCollectionViewID forIndexPath:indexPath];

NSArray *collectionViewArray = [self getToplinksArrayAccordingToTheIndex:collectionView.index];

//  CONFIGURE THE CELL
SMTopLinksObject *dataObject = collectionViewArray[indexPath.item];

//  1. Set the toplink title
cell.title     = dataObject.name;

//  2. Get the default image and blur it
cell.imageName = dataObject.localImageName;

//  3. Activate the preloader that shows the loading status

//  4. Load …
Run Code Online (Sandbox Code Playgroud)

image objective-c ios sdwebimage uicollectionview

6
推荐指数
1
解决办法
4816
查看次数

如何使用NSDateFormatter将字符串日期转换为NSDate

我有以下日期作为NSString:

Thu May 29 14:22:40 UTC 2014
Run Code Online (Sandbox Code Playgroud)

我尝试使用以下代码将其转换为NSDate:

NSDateFormatter *fmt = [[NSDateFormatter alloc] init];
fmt.dateFormat =                  @"EEE MMM d HH:mm:ss zzz yyyy";
NSDate *utc = [fmt dateFromString:@"Thu May 29 14:22:40 UTC 2014"];
NSLog(@"UTC Date:%@:", utc);
Run Code Online (Sandbox Code Playgroud)

结果是nil 我已经尝试了几个dateFormat正则表达式但没有运气.

我在这里错过了什么?

objective-c nsdate nsdateformatter ios

2
推荐指数
1
解决办法
670
查看次数